How to retrieve userid/name from GET requests using REST API
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-04-2018 07:26 AM
I am building a .net core/c# app and using oauth with servicenow. I would like to fetch the user information such as a unique id and name from GET requests. Is there a way to do this ?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-04-2018 11:29 AM
You can use the table api for this. For ex below end point give me a list of 10 user records
https://<your instance>.service-now.com/api/now/table/sys_user?sysparm_limit=10
Please mark this response as correct or helpful if it assisted you with your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-04-2018 11:32 AM
Hi Sanjiv,
What about the id/name for the currently logged in user?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-04-2018 11:39 AM
Then you will have to use transaction table
https://<instance>.service-now.com/api/now/table/v_transaction?sysparm_limit=1
Please mark this response as correct or helpful if it assisted you with your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-04-2018 12:09 PM
I am getting this error when I try to access that url from a non admin account
{
"error": {
"message": "User Not Authorized",
"detail": "User is unauthorized to access table: v_transaction"
},
"status": "failure"
}
This is my GET request
https://<instance>.service-now.com/api/now/table/v_transaction?sysparm_limit=1
Is there something for a non admin account to be able to retrieve their user info?