Getting "User Not Authenticated" message when trying to fetch incidents from postman

Aadil
Kilo Contributor

I have used the below URL to fetch the incidents from an incident table using basic authentication (used ServiceNow username and password), when hit the send from postman, unfortunately getting 401 unauthorized response

GET URL: https://devxxxxxx.service-now.com/api/now/table/incident?sysparm_limit=1

find_real_file.png

can you please guide me to resolve this authentication issue, I tried but could not exact information for the same.

1 ACCEPTED SOLUTION

You need to use the User ID on the profile

View solution in original post

13 REPLIES 13

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

Did you check username and password combination is correct?

Also OOB there is query business rule on incident table so did you check the user is satisfying any records?

Please check with admin user once

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Aadil
Kilo Contributor

@Ankur Bawiskar thanks for your message, where can I get that username and password, I used my login email id and password in postman basic auth and what is OOB?

Hi,

Did you check your email is populated in user_name field? please use that during basic auth

Also please check the query business rule on incident table

Please check whether the user you are using for authentication

1) Is caller

OR

2) Is opened by

OR

3) Is present in watch list

find_real_file.png

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Aadil
Kilo Contributor

@Alikutty Abdulrazak @Ankur Bawiskar thanks a lot for your messages, Finally I am able to get the right information for my dev instance, I am able to fetch the incidents data now using table API, (my bad, before i was trying with admin credentials 😞 )

but one thing I observed here, I have manually created only two incidents in my dev instance but when I fetch the incidents using API, it getting a lot of incidents that I did not create,

why it is so, is that created by some other users and shared over the same dev instance?


API GET details
find_real_file.png

 

My dev instance incidents (only 2)
find_real_file.png

Hi,

if you are admin then query BR won't run for you.

So it is returning all records

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader