- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-16-2019 12:34 AM
Hi everyone,
I'm trying to generate a GET request API which I already have working properly. However, I want my API's response to display the User ID of the requester (wherever there is a user reference) and not their full name. Is this possible through the REST API Explorer?
Thanks!
Solved! Go to Solution.
- Labels:
-
Integrations
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-19-2019 05:00 AM
Hi Rom,
yes you can get the user id column as well
sample endpoint here
GET:
URL: https://instanceName.service-now.com/api/now/table/incident?sysparm_query=number%3DINC0010207&sysparm_fields=caller_id.user_name
Response:
{
"result": [
{
"caller_id.user_name": "george.grey"
}
]
}
in the example: I am getting the caller's user_name i.e. User ID
you need to specify the field you want using sysparm_fields
Mark ✅ Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.
Thanks
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
10-19-2019 05:00 AM
Hi Rom,
yes you can get the user id column as well
sample endpoint here
GET:
URL: https://instanceName.service-now.com/api/now/table/incident?sysparm_query=number%3DINC0010207&sysparm_fields=caller_id.user_name
Response:
{
"result": [
{
"caller_id.user_name": "george.grey"
}
]
}
in the example: I am getting the caller's user_name i.e. User ID
you need to specify the field you want using sysparm_fields
Mark ✅ Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.
Thanks
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
10-19-2019 10:52 PM
Thanks Ankur! I didn't realize that this was possible this way.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2021 04:46 AM
I am unable to set the caller_id and assignment group. I using the npm package of servicenow-rest-api and thereby I calling the api for incident for creating the new incident. I can create any fields accept the caller_id and assignment group. How to achieve this?