REST API Authentication not working

DimaB
Kilo Expert

Hi,

I'm trying to use REST API to get cases. I'm calling this endpoint /api/sn_customerservice/case using this as reference:
https://docs.servicenow.com/bundle/washingtondc-api-reference/page/integrate/inbound-rest/concept/ca...

 

My issue is I'm getting 401 as a response, even though I have username and password configured as Basic Auth (using Postman)

I've also added a new row to "REST API Auth Scopes" section in my instance (not sure if its relevant, just tried to make this work)

I'm using a developer instance.

 

What am I missing?

 

Thanks in advance

1 ACCEPTED SOLUTION

DimaB
Kilo Expert

I was able to figure it out. I used the wrong credentials. Instead if using dev account credentials I used servicenow credentials

View solution in original post

4 REPLIES 4

Mark Roethof
Tera Patron
Tera Patron

Hi there,

 

Can you share test details?

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

LinkedIn

Sure @Mark Roethof 
can you please be more specific? what would you like to get?
I've created a developer account and added some cases there, then tried to use the api to get the cases I created and got 401 as a response using this call

curl --location 'https://*****service-now.com/api/sn_customerservice/case'  --header 'Authorization: ••••••'




DimaB
Kilo Expert

I was able to figure it out. I used the wrong credentials. Instead if using dev account credentials I used servicenow credentials

Mexiprince
Kilo Sage
Kilo Sage

Glad you were able to figure it out.

 401 - unauthorized. Ensure you have the right account/credentials, and the right access to the resource your trying to transact create, read, update or delete (CRUD) operations.

 

https://docs.servicenow.com/bundle/washingtondc-api-reference/page/integrate/inbound-rest/reference/...