10: Deployment
Activity 18: Changing access_token to a Variable in Postman
Solution
- Perform user login and get the access token. Use the POST Token request to get the access token. You should see the following output:
Figure 10.29: Performing user login to get an access token
- Click Manage environments in the top right-hand corner in Postman. Create the
access_token
variable. The value is the access token we obtained in the previous step. Then, click Update:Figure 10.30: Adding more environment variables in Postman
- Select the GET User request. In the Headers tab, change the Authorization value to
Bearer {{access_token}}
, which is the environment variable we added in the previous step, and then send the request. You should see the following output: