Postman Variable Extraction using JavaScript
Budget: $15 – $25 USD
This is a verfy small job to help me get this silly issue off the radar.
I need assistance with extracting a specific postman variable from a collection of fewer than 100 variables. The programming language to be used is JavaScript as I am comfortable and familiar with it. The output will be used in further API requests.
Question:
1.How can I now pick the token from the response from the server? OR any of the other varibles?
Code:
This is a a call to get a login token to an ecommerce site
URL: {{base_url}}/rest/V1/integration/customer/token?username=Paste_username&password=Paste_password
Test environment tab:
const resp = pm.response.json();
pm.collectionVariables.set("customer_token", resp[0].token);
Response in postman:
[
{
"token": "<token in the response>",
"status": 200,
"success": true,
"message": "allowed"
}
]
Ideal Skills:
- Strong expertise in JavaScript
- Experience with Postman API testing and collection
- Familiarity with API requests
This is a small scale project requiring high proficiency in Postman and JavaScript, and an understanding of API requests. Your task will be to extract the variable efficiently and ensure it's readily available for subsequent API requests.
I need assistance with extracting a specific postman variable from a collection of fewer than 100 variables. The programming language to be used is JavaScript as I am comfortable and familiar with it. The output will be used in further API requests.
Question:
1.How can I now pick the token from the response from the server? OR any of the other varibles?
Code:
This is a a call to get a login token to an ecommerce site
URL: {{base_url}}/rest/V1/integration/customer/token?username=Paste_username&password=Paste_password
Test environment tab:
const resp = pm.response.json();
pm.collectionVariables.set("customer_token", resp[0].token);
Response in postman:
[
{
"token": "<token in the response>",
"status": 200,
"success": true,
"message": "allowed"
}
]
Ideal Skills:
- Strong expertise in JavaScript
- Experience with Postman API testing and collection
- Familiarity with API requests
This is a small scale project requiring high proficiency in Postman and JavaScript, and an understanding of API requests. Your task will be to extract the variable efficiently and ensure it's readily available for subsequent API requests.