Integration with Rest API giving 401 Unauthorized error
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-19-2017 11:51 PM
I am trying to integrate ServiceNow with a 3rd Party system using the Rest API. I am able to call the GET requests however for POST getting 401 - Invalid username/password combo.
I have checked the same in Google Chrome Postman and it is working for both GET as well as POST requests.
Inside ServiceNow POST is not working.
I have gone through various posts and came to know that this is recognized as an issue at ServiceNow (Rest Message Authorization ) and the workaround is to manually create an "Authorization" header with a value of "BASIC ****". The * value is equal to the base64 encoding of the credentials, username:password.
I have tried the same however no luck.
Any help would be greatly appreciated.
Regards,
Shahnawaz Khan
- 7,546 Views
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-22-2017 10:21 AM
Does the "Test" related link within your HTTP Method work for you? In my case, the Test button was successfully working, however, a call from a workflow rest message activity produced a 401. The manual authorization header solved my issue. The takeaway from my reply should be to see if you could prove integration from the simplest tool set / scenario in case it is a SN bug.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-23-2017 05:21 PM
Shahnawaz,
which system are you attempting to integrate with?
Also when you use postman via google chrome confirm that the Basic auth is the same in your integration.
Depending on the language that your 3rd party integration is written in the solution can be implemented different.
For some basic integration code go to your ServiceNow instance and go to Rest Explorer use the menu to create your post example and then towards the bottom you will see a hyperlink that allows you to retrieve the code to implement that post via different programming languages.
Hope this helps.