Manage authentication token using Postman variables
Preconditions (2)
Step 1: Send a POST request to the login API with valid username and password in the request body
Step 2: Verify the response status code is 200
Step 3: Extract the token value from the JSON response body
Step 4: Save the extracted token into a Postman environment variable named 'authToken'
Step 5: Send a GET request to a protected API endpoint using the 'authToken' variable in the Authorization header as 'Bearer {{authToken}}'
Step 6: Verify the response status code is 200 and the response body contains expected protected data
✅ Expected Result: The token is correctly saved in the environment variable and used in the Authorization header to access protected API successfully