Node-red HTTP Request

Hello,

I am using Amadeus8 Software to take the Cardholders data into Node-red using HTTP Request, I am getting few HTTP response according, but with API HTTP Request is not working, but I have checked the same HTTP request in Postman Software it is working properly, in node-red it is not giving error statusCode: 401. please find below screenshot and Node-red flow.

Br,
Devendra


flows.json (782 Bytes)

What happens if you open your browser and enter http://192.168.1.100:10695/odata/API_Cardholders?

Also please see this post for the best way to post flows in the future. - How to share code or flow json

please find below screenshot

My Node red flow

[{"id":"93533446.10bb48","type":"inject","z":"e54b8570.a1fd98","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":230,"y":180,"wires":[["60cd882e.4936d8"]]},{"id":"60cd882e.4936d8","type":"http request","z":"e54b8570.a1fd98","name":"","method":"GET","ret":"txt","paytoqs":"ignore","url":"http://192.168.1.100:10695/odata/API_Cardholders","tls":"","persist":false,"proxy":"","authType":"","x":470,"y":180,"wires":[["7cba70b0.3d471"]]},{"id":"7cba70b0.3d471","type":"debug","z":"e54b8570.a1fd98","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":720,"y":180,"wires":[]}]

Well if the url returns a 401 error in the browser then it is not surprising that is what node-red returns when you try to open it there. I notice that you are not providing any authorisation information in the flow you posted. I would have expected the API to require authorisation.

@Colin could you please help me for this. please provide me details what to do further.

I have no idea what authorisation the API requires.

have you added any authorization headers when you are making the request with Postman ?

@UnborN No I just import this two files only. I have not did any authorization headers in Postman.

only ? :innocent:
so apparently whoever send you those files that you imported in Postman had already setup all the critical elements to make the request to the API ?!

check under Authorization and headers to see how Postman is doing the request and
replicate that in Node-red.

image

You can read more on how to setup headers with the Http-request here

1 Like

Yes only this two files I have imported..

Yes, In Postman Already had setup.

Please find below screenshot for Postman Authorization details.

For Postman Headers information.

Br,
Devendra

FYI

I am able to get the response on this HTTP Request, there is issue with Authentication.

Thanks for support.

Br,
Devendra

1 Like

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.