REST API Required to provide Auth information

Kent17
Kilo Explorer

Hi,

I'm new to servicenow and I'm trying to fetch a ticket's details using the REST api. I took a look at the docs particularly this

https://developer.servicenow.com/dev.do#!/reference/api/orlando/rest/c_TableAPI#r_TableAPI-GETid

I tried to call the api using curl 

curl "https://<our-instance>.service-now.com/api/now/table/change_request/166dea65db965050c055927adb9619f6" \
--request GET \
--header "Accept:application/json" \
--user 'username':'password'

 

But it returned an error 

{"error":{"message":"User Not Authenticated","detail":"Required to provide Auth information"},"status":"failure"}

 

Can anyone help me with this or point me in the right direction on how to properly use servicenow REST APIs? Like is there a permission I need to set to my account or do I need to generate a token instead of using password? 

10 REPLIES 10

Hi Vikhyath,

 

When you open the form view of any user, you will see two fields of choice type 

'Locked Out' and 'Active'.

 

You can check in the user table by the name and open the record you can see the field Locked out. If its checked its locked out. 

Madhan27_0-1708975592644.png

 

thomaskennedy
Tera Guru

Token - no.

Is allow access to this table via web services checked?

Does the user have snc_platform_rest_api_access?

If you've not already tried this, copy the url from the REST API explorer into your browser and see what you get.

Hi Thomas,

Thank you for you reply. 

Is allow access to this table via web services checked

Does the user have snc_platform_rest_api_access?

 - I'll have to ask admin since I don't have that privilege.

 

Thanks for pointing out the REST API explorer this wasn't mentioned in the document link I've mentioned above. I'll check this out.

midjoule
Kilo Sage

Hello,

Since it's not written here, another check you can perform is : make sure that the user used for the integration doesn't have the attribute "Password needs reset" set to true.

Best regards