I have a GET api call which returns the following response:
{
"transId": "01",
"Products": [
{
"ProductID": "02",
"ProductName": "Berry"
},
{
"ProductID": "01",
"ProductName": "Apple"
}
]
}
and I wanted the ProductNames to be automatically included in the body of another API request whenever I retrieve that response from that API. (as a variable or something)
{
"ProductsList": [
{
"ProductName": "Berry"
},
{
"ProductName": "Apple"
}
]
}
May I know what should be placed in the Tests portion of the first API to achieve the placing of the product names depending on the number of the products returned, to the body of the second API?
Should be able to have the array be inside the ProductsList array body.