I am new to Postman and completely new to Javascript.
I ran a Post request to create a new contract.
Request Body
{
"progSrvcNm": "009",
"contractPrtyNm": "PostmanAutomationContract",
"contractCd": "000",
"signDt": "2018-01-01",
"startDt": "2018-01-01",
"endDt": "2025-01-01",
"remitTerms": 30
}
and received an ok Response with the new contract number as the response body.
"02974"
I now want to save the response body and use it in a Get request to confirm the data I sent in the Post is what is returned in the get for the new contract.
I attempted to save the variable and use the 'Send Request' snippet in Postman, and when I run I only get a response of another new contract number created.
let newContractNb = pm.response.json();
pm.sendRequest("http://smat-meddev02/MedeaSMATMEDSQL01AICollationFNGAPI2.AffiliateApi/api/Get/" + newContractNb, function (err, response) {
console.log(response.json());
});