-1

I have API request which gives data and a link to the next page. I want postman to use this link as my next API request without my input.

f.khantsis
  • 3,256
  • 5
  • 50
  • 67

1 Answers1

0

You can do this by adding some code in the Tests section of the postman request. First, parse the response received after your first request using - var jsonData = JSON.parse(responseBody);

Now extract the link you want to use for your next call from jsonData and then make your next request using pm.sendRequest().

Refer https://blog.getpostman.com/2014/01/27/extracting-data-from-responses-and-chaining-requests/ and https://blog.getpostman.com/2017/10/03/send-asynchronous-requests-with-postmans-pm-api/ for more info.

Derryl Thomas
  • 1,324
  • 12
  • 22