I didn't quite understand if you are aware, but Postman has scripting and can depend upon data from another. And even can query it serially if you add requests to folder, right click on folder and "Run folder".
Scripting is under Tests tab.
I've built oauth2 authorization flow to get the code and afterwards the access token.
First request Test script:
pm.expect(pm.response.code).to.equal(302);
var code = pm.response.body;
var location = pm.response.headers.get("Location");
if (location.match(/\\?code=([^&]+)/) === null) {
postman.setNextRequest(pm.info.requestName)
console.log("Request must be re-run. First time adfs wants to set some cookies, eh.")
} else {
var code = location.match(/\\?code=([^&]+)/)[1];
pm.environment.set("oauth2_authorizationcode", code);
}
Scripting is under Tests tab.
I've built oauth2 authorization flow to get the code and afterwards the access token.
First request Test script:
Second request Test script: Scripting: https://learning.postman.com/docs/writing-scripts/script-ref...