Scripted REST API not able to access request
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-13-2022 09:24 PM
I have created a Scripted REST API to get user criteria for a user.
The script I'm using is:
(function process(/*RESTAPIRequest*/ request, /*RESTAPIResponse*/ response) {
var queryParams = request.queryParams;
var userID = String(queryParams.user);
return new sn_uc.UserCriteriaLoader.getAllUserCriteria(userID);
})(request, response);
I'm passing the user id in the request, and I've added a custom ACL for this REST endpoint. The error I'm seeing when making a call to this endpoint is:
{"error":{"message":"Access to RESTAPIRequest from scope <app_scope> not allowed","detail":"Access to RESTAPIRequest from scope <app_scope> not allowed"},"status":"failure"}
What am I doing wrong here?
FWIW I have gotten this to work before, but I think I might be missing an extra step this time
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-13-2022 09:31 PM
Hi,
So when it worked earlier what was the change you did now?
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-13-2022 10:33 PM
i was able to get it to work, had misconfigured something, thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-07-2022 10:20 PM
Hi Shaan
I am getting the same error while making call to the endpoint for webhook.
previously it is working for me. can you please help, how you resolved this issue.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-07-2022 11:40 PM
@Shaan2 Try to add a cross scope privilege and check
ServiceNow Community Rising Star, Class of 2023