- 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:34 PM
Ah.. got it to work finally.. did not notice that when you change the password... the "Password Need Reset" is enabled.. disabled it and was able to connect and perform the action.
Thank you very much.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-04-2022 06:55 PM
HI @Kdomingo
Good job!
And one more be careful thing is that if the password contains "$" or other special characters,
change the default Double quotes to Single quote.