How to use SessionID with PostMan Rest client

Getting "SessionId" from user response during a session using POSTMAN REST client.

How to use sessionId for other GET request API calls?

+3
api postman


source to share


1 answer


After making a few assumptions about your data structure, store them as a variable:

//parse the response body as JSON 
var data = JSON.parse(responseBody);

//create a global variable that can be reused in another call
postman.setGlobalVariable("sessionId", data.SessionId")

      



To be used in a call to a different endpoint:

http://www.example.com/ {{sessionId}}

+3


source to share







All Articles
Loading...
X
Show
Funny
Dev
Pics