Basis Auth error in Rest APi Explorer

Sandhya23
Tera Guru

Hi all,

I'm experimenting with my Rest API through Postman. I've given the credentials for authentication. Itt works perfectly for the Post method, creating an incident but it encounters an "User not Authenticated" error when applied to the Get method

What could be a reason behind this?

1 ACCEPTED SOLUTION

Sandhya23
Tera Guru

Hi All,

 

Thank you for your replies. The problem originated from a custom role that was blocking the GET operation. Once the role was assigned to the service account, everything worked as expected and the error just disappeared.

View solution in original post

5 REPLIES 5

Sujatha V M
Kilo Patron
Kilo Patron

@Sandhya23  Sharing the below link for reference, 

 

https://www.servicenow.com/community/platform-analytics-forum/getting-quot-user-not-authenticated-qu...

 

Please mark this as helpful and accept it as a solution if this resolves your query.

Thanks,

Sujatha V.M.

Please mark this as helpful and accept it as a solution if this resolves your query.
Sujatha V.M.

Sandhya23
Tera Guru

Hi Sujatha,

 

Thanks for sharing the link. However, it does not solve my problem. I am using the right user ID and password. this works fine for the POST operation and I am able to create incident in the system with the credentials in the postman. But it does not work for the GET operation. I am getting the mentioned error.

Amit Verma
Kilo Patron
Kilo Patron

Hi @Sandhya23 

 

To debug it further, I would suggest you to try this out first using ServiceNow REST API Explorer available within your instance. Test for GET method. If that works out for you, then definitely it has something to do with your credentials. 

 

If the GET method works, take out the ServiceNow script or PowerShell or Python script from there, put your credentials into it and retry.

 

Thanks and Regards

Amit Verma


Please mark this response as correct and helpful if it assisted you with your question.

Pratiksha
Mega Sage
Mega Sage

Share the end point you are trying to use. Amit suggested right, you can check REST APIExplorer. Make sure you imporsante with the user you created for basic auth.