Newbie - REST API

Kdomingo
Tera Contributor

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

1 ACCEPTED SOLUTION

newhand
Mega Sage

 

@Kdomingo 

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  !

Please mark my answer as correct and helpful based on Impact.

View solution in original post

11 REPLIES 11

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.

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.

Please mark my answer as correct and helpful based on Impact.