REST/Table API-Session Reuse for multiple request
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-07-2016 01:43 AM
I am using REST/Table API for ServiceNow.
To process multiple requests , I am sending request to servicenow endpoint in a for each Loop.
I had a query here : In servicenow, for multiple requests, is the session maintained?
or Is there a provision using which I can Reuse the connection with ServiceNow for multiple requests ?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-07-2016 05:33 AM
Hi Bhavna,
Can you help me understand what the goal is here?
If it's a simple question about sessions, then as far as I know, it's a new session each time and authentication needs to be passed. I can double check with our developers to see if the session header token thingy (often visible in the REST API Explorer) has any impact on that.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-28-2016 01:26 PM
Hi Chuck,
I ask me the same question than Bhavna.
We can see on the wiki/docs : "REST supports cookies for binding to the existing session.".
(Fuji : http://wiki.servicenow.com/index.php?title=REST_API#gsc.tab=0)
(Helsinki : https://docs.servicenow.com/bundle/helsinki-servicenow-platform/page/integrate/inbound-rest/concept/...)
Unfortunately, we don't have more information and/or example to use coockies in REST API.
Simple example :
We have two instances, Dev1 and Dev2.
Case 1 : From Dev1, we use the REST API to contact Dev2. We want load an incident and a problem. So wemake a REST API to load the incident and we want to used the cookies session to load the problem. Theorically it's possible...
Case 2 : From Dev1, we use the REST API to contact himself to load all active incident in JSON format. We want to used the token session because we are connected to the instance. Theorically it's possible...
Thanks for your time
Regards,
Florian.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-29-2016 05:19 AM
Hi Florian,
Using the REST API this way is beyond what I've done so far. You might want to reach out to support to see what they have to say.
HI Service Portal - ServiceNow
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-29-2016 06:01 AM
Hi Bhavna,
Might OAuth suit your needs?
Enable OAuth with inbound REST
Using OAuth, you can pass a user ID and password once, and then use a token for subsequent REST requests instead of submitting credentials with each request.
Best Regards
Tony