- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-21-2025 11:15 AM
- I have created a role called `data_exchange`.
- I have elevated my permissions so that I can create ACLs.
- I have created a new ACL for reading `sys_dictionary.*` and added my role to it.
- I have given that role to the Abel Tuter user.
Now I'm trying to use the REST Table API to query the table. I have OAuth all set up for that. However when I make my request, I get back this error:
{
"error": {
"message": "User Not Authorized",
"detail": "User is unauthorized to access table: sys_dictionary"
},
"status": "failure"
}
Here is what my ACL looks like:
Here is what my user looks like:
Do I need to add more ACL to the role so that the user can make this query?
Here is my query, for reference:
# specifics and secrets are omitted from this post, but assume I have the following defined:
CLIENT_ID="OMIT"
CLIENT_SECRET="OMIT"
INSTANCE="OMIT.service-now.com"
# to get the access token:
curl \
--url "https://$INSTANCE/oauth_token.do" \
--header "content-type: application/x-www-form-urlencoded" \
--data grant_type=client_credentials \
--data client_id="$CLIENT_ID" \
--data client_secret="$CLIENT_SECRET"
# then, assign it to a variable:
ACCESS_TOKEN="OMIT"
# finally, I'm ready to make the request:
ENDPOINT="/api/now/table/sys_dictionary"
sysparm_query="name%3Dincident"
QARGS="sysparm_query=$sysparm_query"
curl -XGET "https://${INSTANCE}${ENDPOINT}?${QARGS}" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Accept: application/json"
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-21-2025 08:25 PM
I needed to give ACL for `sys_dictionary` *AND* to `sys_dictionary.*` to get it to work.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-21-2025 08:21 PM
why to use this?
What's your business requirement here to give access to Dictionary table other than admin?
I won't recommend as this is system table
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-21-2025 08:26 PM
I need to fetch the fields of an incident and this is the only place that SN exposes it. If it's not recommended, then that's an implication for the general use of SN more than anything.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-21-2025 08:25 PM
I needed to give ACL for `sys_dictionary` *AND* to `sys_dictionary.*` to get it to work.