SoapUI — API Request Response chaining with JSON
Extracting JSON Response and use it in the next API Request (REST API)
This article shows how to extract value from a JSON response in a REST API and use the value in any other subsequent API Requests in SoapUI
Request1: For a Sample REST-API, let's use this which is giving the list of users. Add a GET request for the below endpoint from SoapUI.
https://reqres.in/api/users?page=2
Request2: Add another request of PUT type, this will update one of the users.
Request Body:
{
"name": "morpheus",
"job": "zion resident"
}
Now create a new TestCase from TestSuite and add the above two APIs to the TestCase
Let's take the first_name from the response of the first API and add that value to the request of our second API.