REST API User Not Authenticated

tpoeckes
Giga Guru

I'm trying to create records in an import set via REST API.   I have the REST API using the Import Set API name.   https://instance.service-now.com/api/now/import/u_test.   I have created the security rule for "create" and added the rest service role to this table.   I have created a new user called restapiuser and checked the "Web access service only" and added the "rest service" role.   I'm using Postman to send REST API request.   When I use admin it works but when I use restapiuser I get not authenticated.   I seems like it doesn't have access to the table.     Is there any other ACLs that need to be set so restapiuser to write records to the u_test import table?

14 REPLIES 14

This is the error.  



401 Unauthorized



<?xml version="1.0" encoding="UTF-8"?>


<response>


      <error>


              <message>User Not Authenticated</message>


              <detail>Required to provide Auth information</detail>


      </error>


      <status>failure</status>


</response>


Hi Thomas,



Then i would check whether the active is check box enabled on the user record. Locked is unchecked? lastly, USER_ID and Password I am passing is correct?.



Thanks


Srini


I figured out the problem.   Every time I would update user record restapiuser, the userid got switched to "admin".   When I saved my changes for the record I always put back in restapiuser but never updated the password.   So this time I updated the UserID and Password and now it works.   So I'm suspecting it had the admin password linked to the restapiuser.   Does anybody know why when you update a person's UserID that it fills in the UserID with the current user logged on?  


Community Alums
Not applicable

Are you sure it is filling in with the currently logged in user? It sounds like something I've seen with browsers and saved credentials: The browser is trying to fill in the fields the help you log in as if you were on a login page...


Ben,



That was the problem.   Credentials was saved and it was entering them into every UserID record that I would edit.   Thanks so much for your help!!!!!