How do I pull a value from one request to be part of the URL of a second request?

Frank
Thu, 28 May 2020 06:25:08 +0000
Help Hub

I’m on day 1.5 of learning API, Postman, and coding in general. My working project is getting data from Qualtrics.

Here is the page from their support site:
https://api.qualtrics.com/reference#create-response-export-new

I’m stuck on one point. I think I found the answer but I don’t know enough to fully understand it yet.

To get data from Qualtrics requires three requests (I put only two below for brevity). The URL for the second request includes a value from the previous request. I’ve put them in a Collection.

How do I pull a piece of data from a request to be part of the next URL?

Here is part of the output of the first request:

{
    "result": {
        "progressId": "ES_736T0pNmloCLoyx",
        "percentComplete": 0.0,
        "status": "inProgress"
    }
}

In the 2nd request, the URL is: https://###.qualtrics.com/API/v3/surveys/###/export-responses/{{THEPROGRESSIDVALUEFROMABOVE}}

I read about setting an environment variable, and I included the following in the Tests section of the first request:

pm.environment.set("progress_key", WHATGOESHERE?);

I’m not sure what to put for the value so that it pulls the actual value from the result. Or is there some other way to do this? Thanks all!

5 posts - 2 participants