I have set up a collection in PostMan and am able to save my bearer token value to an environment variable successfully using the following test
var jsonData = JSON.parse(responseBody);
pm.environment.set("mytoken", jsonData.token);
but how do I set up a new call to use it?
I have tried adding a Header with
Authorization Bearer <mytoken>
but when I Post the Status is 401 Unauthorized
pm.response.json()
instead ofJSON.parse(responseBody)
– Eructate