How to set Dynamic variable Token in Postman API
Postman is most populer API tester for Web Developer, Mobile Developer, Etc. You can colaborate with Teams and sharing API with others.
You can set Variable based from response request like accessToken, statusCode, and many variable that you want.
Open Postman and Login
Create Environment (Click eye icon of environment)
Example use “accessToken” variable
In this case, I have Login API for example
I will store “accessToken” from JSON Response to “accessToken” variable
Click Tests Menu
Ensure you have select Enviroment and type script inside tests menu like bellow:
Click send button and check variable accessToken that will be change with new accessToken from JSON response.
You can use accessToken for each request with authorization
You can use that in header Authorization