REST/Table API-Session Reuse for multiple request

bhavnagyanchand
Kilo Explorer

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 ?

14 REPLIES 14

There is an example here:


REST OAuth example


which shows how you can get, and use, an access token


JC Moller
Giga Sage

Hi,



Very important topic. Always develop your integration to use a persistent session.



More on this:


Troubleshooting inbound integrations performance


https://hi.service-now.com/kb_view.do?sysparm_article=KB0564204



REST and other integration traffic often leads to stale session buildup and scarce available memory


https://hi.service-now.com/kb_view.do?sysparm_article=KB0552064



Develop your integration to use a persistent session


https://wiki.servicenow.com/index.php?title=Direct_Web_Services#Persisting_HTTP_session_across_all_S...



- Jan


Hi,



There is also a new system property available in Helsinki.



glide.integration.session_timeout



"Decrease the maximum integration session duration by adding the property glide.integration.session_timeout to the System Properties [sys_properties] table.


This property accepts an integer value that specifies the number of minutes to keep integration sessions open. This property is set to 5 by default, keeping integration sessions open for 5 minutes"



https://hi.service-now.com/kb_view.do?sysparm_article=KB0552063



- Jan


johnram
ServiceNow Employee
ServiceNow Employee

The ServiceNow Wiki content is no longer supported. Updated information about this topic is located here: Direct Web Services



Visit http://docs.servicenow.com for the latest product documentation


josh_nerius
ServiceNow Employee
ServiceNow Employee

Hi Bhavna,



You can maintain the session by maintaining the cookies returned by the initial request. Most HTTP client libraries will support this. As long as you maintain cookies, the same session will be reused across multiple requests.