Unauthorized error while calling endpoint without admin role
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2023 09:57 AM - edited 06-13-2023 11:43 AM
I have a rest message defined and consuming below api.
I am calling REST API using script include and when submitting request with admin role, it is working fine and returning 200 status code. When ITIL user is submitting request it is giving Unauthorized error. When I am providing admin role to user it is working fine. Could anyone please suggest which role I need to provide for accessing REST API endpoint.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2023 10:10 AM
I would check to see if there is a role needed to access the end point. Without knowing which web service you are using its difficult to know.
But if it works as ADMIN and not as ITIL then its a role issue.
SOAP Roles are here and there are similar ones for the REST API.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2023 11:42 AM
I am consuming below api into sn.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2023 11:45 AM
Oh, so in ServiceNow you are making an outbound call to a web service. How are you going about it? Are you making the call from the client or server side? Did you setup an outbound web request or do something else?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2023 11:51 AM
I consumed API under outbound -> rest message. Defined get and post method and using OAuth2.0 authentication type.
I have provisioning workflows where I am calling script include, which is calling above API with all parameters.
When I am submitting request into SN, it is working as expected and when itil user is submitting request it is giving 203 error.