I log in, then get the token
. I stored that varibale and use it throughout my next collections.
let location = pm.response.json().location
let token = location.split("?token=")[1]
console.log('Token : ',token );
When I get the token
, I can use that token
to call my next API call.
Let's say I call : cpe profiles, I will get a list of profiles in my CPE
{
"id": "32341696-80c4-4597-998b-5f6cbe7d5a48",
"group": "a5dd9ed2-f9c6-4d23-9623-de0cae4d4aa8",
"name": "Jane",
"dob": null,
"image": "assets/profile/e6398f955035eb1a6a297739fedcc770.png",
"cpe": "E8DE2799DD87"
}
I want to create dynamic variables for all my profiles "{{profile.name}}_ID"
1 profile, I want to create 2 variables.
JANE_ID = "32341696-80c4-4597-998b-5f6cbe7d5a48"
JANE_GROUP = "a5dd9ed2-f9c6-4d23-9623-de0cae4d4aa8"
Then, I can access that avarable later on
How can I create a dynamic variables in Postman ?
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.