Pre-request script doesn't change the collection variable - 30 days of Postman(Day 27)


As you can see, the response code is 200 but it reads the previous response code which was 403.

Hi @semihberkay

The 200 response code is for the main API call that is being made.

The 403 is because the pm.sendRequest('http://security.postman-breakable.com/account/${user_id}/summary' call is failing in the pre-req script.

You can use console logging to see this;

console.log("response.status", response.status);

Can’t tell from the screenshots why this is, but my first recommendation would be to check that you have added your API key to the X-API-key headers.