REST API User Not Authenticated
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-11-2016 07:50 AM
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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-11-2016 08:19 AM
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>
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-11-2016 08:27 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-11-2016 08:52 AM
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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-11-2016 08:59 AM
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...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-11-2016 09:35 AM
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!!!!!