REST API not able to authorize login
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
8 hours ago
We are looking to extract data via the REST API. When attempting to do we are presented with a 401 error in postman and also other methods of calling the endpoint. We are definitely using the correct username and password via basic auth. Co-pilot suggests it could be a permissions setup as we are using SSO for other accounts in the business. Could this be possible? How do I stop SSO interfering with the service account calling the API endpoint. This is unlike the other like this in the community forum, we don't wish to extract data from dev.
This is the endpoint being attempted api/now/table/sys_user?sysparm_limit=1
Example error
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
7 hours ago
Sometimes if I wait 10 mins it will work but the stop working again when directly using the endpoint url and logging in to get the results. Not worked yet in postman however
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
7 hours ago - last edited 7 hours ago
Hi @dshallcross
Sometimes if you have keyboard issue, may be typing not work properly.
First try to open end point with that credential (TESTING). If working->Type in notepad and from there paste in postman.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
7 hours ago - last edited 7 hours ago
Hello @dshallcross
Navigate to All > System Web Services > API Access Policies > REST API Access Policies (Table Name: sys_api_access_policy) and find out whether Table GET API Access Policy is set to Active as True or False:
If True as shown below, then you can get 401 error:
Sometimes if I wait 10 mins it will work but the stop working again when directly using the endpoint url and logging in to get the results. -> Because browser can use existing SSO web session.
Hope that helps!
