I’m not an expert, I’m sorry I wasn’t able to find this but I’m trying to include a test in order to console.log the response body of the json after the api response comes back.
I attempted the following:
var jsonData = pm.response.json();
console.log(JSON.stringify(jsonData.results))
I think this might have to do with needing to do a function now?
Does everything need to be in a function like:
pm.test(“console log”, function () {
var jsonData = pm.response.json();
console.log(JSON.stringify(jsonData.results))
});
If you just wanted to log the whole response body to the Postman console, this would be all you need.
console.log(pm.response.json())
You can also see this information in the without adding the console.log() statement to the sandbox environment. If you expand the network information for the request, from the console, you will be able to see the response body data.
Did you want to capture some specific values from the response? If so, could you add a sample of the response to the question and we can work out a solution for this too.
I’m running the collection runner through a list of ids I need to have the user account either created, or suspended in Zendesk in this user case. the output i’m looking for is the response body for each instance.