C.K.
C.K.

Reputation: 5528

Postman How to use the value from response and use it in request afterword

Is there a simple way in Postman to:

Or

I want the chaining requests of a collection or a folder without stop and edit every request body.

Upvotes: 0

Views: 664

Answers (1)

C.K.
C.K.

Reputation: 5528

Let's say I want to create a new obj called 'qif' then get its id, and then update it.

  1. In Postman open the first request - Test tab enter:
var jsonData = JSON.parse(responseBody);
pm.environment.set("new_create_qif_id", jsonData.id);

enter image description here

  1. after sending the request you will get the environment valuable new_create_qif_id ready.

enter image description here

  1. use {{new_create_qif_id}} in request body or URL, it will be updated every time we run the collection or folder

enter image description here

Requesting token is just the same.

Upvotes: 1

Related Questions