Chaining Requests

Let's say that in our test we want to use data returned from the first API call to make another call to the API. This chaining can help us create complex tests that validate the full functionality of the API and not just individual endpoints.

To do that, add a new HTTP request step and fill in the parameters. To use data from the original request, you can add is as a template, like: {{a.data.id}}.

This syntax can go anywhere โ€” in the URL, in a header value, param value, or the request body. The red box references the result of the first API call, which was saved as "a".

18741874

Every API request has a "Variable" setting. This defines the name of the variable that the response will be saved into. You use this variable in subsequent test steps to use data from the API & make assertions on the response. In the image below, the result of the API call will be saved into the variable "b".

18781878