- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-15-2019 02:20 PM
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?
Solved! Go to Solution.
- Labels:
-
Integrations
-
Scripting and Coding
- 3,433 Views

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-15-2019 03:00 PM
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

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-15-2019 02:24 PM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-15-2019 02:38 PM
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!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-15-2019 02:49 PM
Do you mind to share your REST endpoint?
You can hide instance name from REST API endpoint.
Regards,
Sachin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-15-2019 02:48 PM
Is the message set to go through a MID server which is down?
Could you possibly share the REST msg ?