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
‎12-08-2022 08:48 AM
It is working after adding cross scope privilege. but why it is not working without cross scope privilege now , and previously it is working. I did not change anything regarding cross scope .
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-08-2022 08:52 AM
@Abhishek145 Cant say what's the exact issue as I don't know the whole scenario. But if your issue is resolved please mark as correct answer.
Thank you
ServiceNow Community Rising Star, Class of 2023