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.
In the headers, I needed to use:
For the key:
Authorization
For the value
Bearer {{mytoken}}