how can i get user session id outside of the servicenow instance using rest api.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-11-2018 04:41 AM
I have developed custom application using C# windows application. And i have using my servicenow developer instance rest api url to retrieve rest request and response from servicenow instance. And i actually using basic authentication to retrieve rest response in my custom application. How can i get session id from servicenow instance to my custom application.
For example: My Instance https://dev.service-now.com/ My Rest api url is: https://dev.service-now.com/api/now/table/{tableName}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-11-2018 02:21 PM
hi Sakthival,
Have u try using rest api querying table v_user_session?
this table should give u your loggon session id.
Hope this helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-12-2018 12:08 AM
Hi Bryan,
I tried to getting session from v_user_session table that's ok. But i want to get session id from my custom application to make continues rest request.
And i already using this v_user_session table to get user session. For is there any custom script file is available in servicenow instance.
Thanks
sakthivel

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-14-2018 02:30 PM
hi Sakthival,
in your custom application, once you initiate your first connection to the server via rest api call, your session had been stored at v_user_session table.
if u need the session_id, query the v_user_session table to retrieve it as the first rest call and then store the session id for the subsequent call.
i use poweshell as an example:
Hope this helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-17-2018 03:28 AM
Hi Bryan Tay,
Thanks for your reply. Its very helpful for me.
Is there any possible to get session id without using username and password. When user log on to servicenow instance. We have only developer instance login url and rest api url only that time how can we retrieve user session id without using credentials for make subsequent rest/soap request.
Thanks for advance.
Sakthivel.