JSON input to a REST POST call failing

Hello All,

I am trying to send a json document as input in the body of a REST POST call. The configuration of the REST Snap is in the image attached below. I am getting a 401 error, “REST API service endpoint returned error result: status code = 401, reason phrase = Unauthorized, refer to the error_entity field in the error view document for more details”
I ran the same call in Postman and it worked just fine. It would be really great if someone could help me configure the Snap right to make it work. Thanks!

3 4

I think most apis have no way of passing/remembering the authorization, and postman gets away with this by having an option to set the headers:

On MY example here, I would have to call the API with the logon sequence, parse the access token out, and replace {{accessToken}} with that value. You can test all that with a copy of the reference in postman. Also, check the headers, and make sure you are passing all of the needed ones, and no improper ones.

On your example, you would have to add the header as an “HTTP header” on the REST call. I believe that is the way many work. SOME work by typing the ip to the login, but even then you have to login, in some way.

Another way of authenticating and authorizing an HTTP requests is through an account. The REST Post snap can use these accounts:

image

Otherwise, you’ll probably need to configure the snap with the correct method of auth for that end point.

Thanks for the help! I played around with the configuration as per the documentation and the REST POST worked. The Oracle environment we were trying to push the data to was being refreshed which was partially the reason for the errors.

1 Like