Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

172
Views
Geting specific response body from response and put in a variable in Postman

I am trying to set the response in a variable but the response is just an ID, not an object. I used

var resposseBody=pm.response.json(); 

or

var resposseBody=pm.response.text();

but they didn't work. How can I set the response below in a variable?

"3707ff3d-2af9-4ea1-a6aa-08d9a8ee3cb3"

about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

To save that value to a variable, add this to the Tests script:

pm.globals.set('id', pm.response.text());

This is an example using the global scope but the variable can be set at the Environment or Collection level.

There aren't many details in your question so it's difficult to offer any more of a solution than this one.

about 4 years ago · Juan Pablo Isaza Report

0

If the response is in json format, like

{"id":"3707ff3d-2af9-4ea1-a6aa-08d9a8ee3cb3"}

then you can get simply with

responseJsonData=pm.response.json();
responseId=responseJsonData.id;
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!