- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-18-2018 09:06 AM
hello
i have created a scripted rest api
https://xxxxxxxxxxxxxxxxxxxxxx.service-now.com/api/catsf/createrequest
i have 3 users from 3 different domains accessing this path
can i get the user who has accessed this path when it is called, In scripted api so that i can check the domain of that user and allow him to create request in that domain, if he is member of that domain??
thanks in advance
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-18-2018 12:44 PM
If you want to get the user information in the scripted rest API. You can log them in the script part of the Resource. Once you get the user information , you can do gliderecord on sys_user table or use gs.getUser().getDomainID(); to get the Domain information and proceed further.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-18-2018 10:20 AM
Does your scripted web service use authentication ? we use gs.getUserID() to get the user ID as we have multiple servicenow service accounts using the same scripted web service .
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-18-2018 12:44 PM
If you want to get the user information in the scripted rest API. You can log them in the script part of the Resource. Once you get the user information , you can do gliderecord on sys_user table or use gs.getUser().getDomainID(); to get the Domain information and proceed further.