How to efficently chain API requests endpoints


#1

Hello all,
I have been working with Postman for the last two months;
I have been testing an API that chains lots of API endpoints request to create an environment; I need to pass values from an endpoint to another;
Is there a faster way to do it, I mean, Can we code the requests and pick the answers in a coding language function and not only with the normal PostMan interface of pre-test and post-test examples.
For instance, use Python to create a function that chains all the API’s and passes the data from a response to a request.


#2

You chain requests and create workflows using pm.setNextRequest. You can read more about building workflows here - https://learning.getpostman.com/docs/postman/collection_runs/building_workflows/#advanced-workflow.

To pass data from one request to another, you should use environment variables. Set/retrieve data from them in the pre-request script or test script (post request). You can find information about the sandbox API here - https://learning.getpostman.com/docs/postman/scripts/postman_sandbox/#pm-apis