Harsha W
Harsha W

Reputation: 3376

How to specify Access Token in PostMan

I have imported a JSON file in to postman and the JSON Body is requesting Authorization Bearer value for a specific parameter. How to set a value to the parameter. Currently its undefined. Please refer the below JSON code and image.

"name": "Pos_TC-Name", "event": [ { "listen": "test", "script": { "type": "text/javascript", "exec": [ "tests[\"Status code is 200\"] = responseCode.code === 200;" ] } } ], "request": { "url": "http://localhost:52586/api/Patient/7", "method": "GET", "header": [ { "key": "Content-Type", "value": "application/json", "description": "" }, { "key": "Authorization", "value": "Bearer {{NurseAdminToken}}", "description": "" } ], "body": { "mode": "raw", "raw": "" }, "description": "" }, "response": [] },

Issue

Upvotes: 0

Views: 1171

Answers (1)

Faheem
Faheem

Reputation: 1453

You have to define the variable as a global under Manage Environments You click on the "Settings Wheel" top right half of the window. Then you select/switch to the environment where you defined the global (the drop down menu next to the setting wheel).

Upvotes: 1

Related Questions