- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-04-2022 05:00 PM
Hello and Good Evening.
Hope everyone is well. Am very new to Servicenow..... created a PDI to play around and one of the things I am looking at is the ability to create/update records (incidents, requests, change orders) via webservices/REST API. I was able to test this within the PDI via REST API Explorer however, when testing this using (perl or powershell) scripts outside of the PDI, and using the default "admin/admin" userid and password combination, I am getting the "Invoke-RestMethod : The remote server returned an error: (401) Unauthorized." error. Is there anything I have missed that needs to be configured for the "admin" account in the PDI and/or network related settings that needs to be configured to allow me to make webservices/REST API call to the PDI?
Thank you very much.
br
ken
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-04-2022 05:35 PM
I think the script you are running is from the REST API Explorer page .
The script you are using is just Code Samples,so you need to change the "admin/admin" part with your own userid and password combination.
If you don't know the password of "admin" , change it first !
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-04-2022 06:09 PM
hello Sir.
tried postman using basic auth... and getting the same unauthorized results... may need to use/configure OATH.....
Best regards,
ken
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-04-2022 05:27 PM
@Kdomingo you may also refer on this community post REST API and IntegrateNow: Chapter 3 (REST API Explorer).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-04-2022 05:35 PM
I think the script you are running is from the REST API Explorer page .
The script you are using is just Code Samples,so you need to change the "admin/admin" part with your own userid and password combination.
If you don't know the password of "admin" , change it first !
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-04-2022 06:27 PM
HI @Kdomingo
Can you just check my replay....
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-04-2022 06:30 PM
Thank you very much.
Tried updating the password for the "admin" user in my PDI.. plugged the generated admin password into my script as well as postman (Basic Auth).. still getting the same not authorized result.. 😞
Best regards,
ken