Extracting value from requestBody and using it in mockResponse
Hi,
I am using Service V to create a mock response and I want to extract data from the json request body and use it in the response.
The following is the json request body ..
{
"employName": "Pat McGraff",
"companyId": "80966",
"contactDetails": {
"emailAddress": "patmcgraff@gmail.com",
"phoneNumber": "8427306667"
}
}
I basically want to just use this same block in my mock response with additional data e.g. the response body would be
{
"employName": "Pat McGraff",
"companyId": "80966",
"contactDetails": {
"emailAddress": "patmcgraff@gmail.com",
"phoneNumber": "8427306667"
}
},
"company": "company123",
"location": "India",
"client": "client123",
"team": "BIG"
}
Is there a way I can do this using the context and requestContext in Service V in the scripting dispatch method?
Many thanks.