Outbound REST error - working in Postman

Cheri M
Kilo Sage

Hello all,

I am developing in Madrid. I wrote an outbound REST API to an endpoint that is NOT behind a firewall. I receive the error "Unknown Host" and error code 1 in the Test UI, in the logs the error is [ERROR CODE: -1 ]. I copy the code and endpoint in Postman and receive the correct response. At first I thought it might be headers but I pretty much just copied the headers from Postman and received the same results (unknown host).  I can go directly to the endpoint url in a browser and see the data. What am I doing wrong?

1 ACCEPTED SOLUTION

DScroggins
Kilo Sage

Hi Cheri,

 

If you get the 'unknown host' error then the SN instance cannot reach the endpoint. Im assuming the browser you are using to validate the endpoint is connected to a company network? If so can you try to access the endpoint via a device not connected to the same network i.e. take your phone off wifi and then use the cellular network to access. If you are still able to reach the endpoint then you know there is a problem with the Outbound REST message from the SN side. If you are not able to reach using the non-network connected device then you know that SN is unable to reach the endpoint and will need to utilize a MID server.

 

Hope this helps.

 

--David

View solution in original post

8 REPLIES 8

sachin_namjoshi
Kilo Patron
Kilo Patron

Use REST API explorer to generate sample header and payload to test your REST API.

 

https://developer.servicenow.com/blog.do?p=/tags/rest-api-explorer/

 

Regards,

Sacin

This is outbound, I am using the Outbound REST module which shows the example code and clicking the TEST UI action within that form. I copy that code and use it in Postman without issue. I am not sure how using REST API to generate the sample headers would help when you can only add headers in the Outbound REST module but it does not show up in the example text. Please explain?  Thanks!

Do you mind to share your REST endpoint?

You can hide instance name from REST API endpoint.

 

Regards,

Sachin

kente
Tera Guru

Is the message set to go through a MID server which is down? 

Could you possibly share the REST msg ?