Response on MOCK Server

  1. I am Using POSTMAN to send a post request to enroll a user.

{

“TransID”: 001,

“UID”: “0000374490-SQLSITE002”,

“FileName”: “0000374490-SQLSITE002_E00_V00_R01.raw”,

“EnrollSessionID”: 24,

“CallBackURL”: “http://192.168.0.150:5000/api/values”

}

  1. The CallBackURL is a mock server and it receives the response of the post request.

This is the response that is displayed on the mock server:

Got POST Request: {

“TransID”: “001”,

“Result”: 1,

“Message”: “Session ID Not Found”,

“ErrorCode”: 1053,

“Data”: “{“State”:2,“Count”:1,“EnrollSessionID”:24}”

}

  1. I have to use the EnrollSessionID from the response in another POST request.

My question is…

How can I parse the response for the EnrollSessionID when the response is on the mock server?

I am not sure if I understood your question correctly.

If you want to read an attribute from your response you can use the below piece of code in your test script.

let responseJSON = pm.response.json(),
 enrolSessionID = responseJSON.Data.EnrollSessionID;

console.log(enrolSessionID)