0

I have to write postman test for below requests.

  1. Post {{url}}/{{version}}/Customers will return customer object which contains customerId

  2. Get {{url}}/{{version}}/Customers/{{customerId}}

So I need to run both request according to above sequence

So when the Customer is created then assign {{customerId}} so Get request will return new customer id.

Is this possible to chain the result (customerId) post request to get request

smith
  • 73
  • 1
  • 8
  • 1
    What's the structure of the response object? Adding `pm.globals.set('customerId', pm.response.json().path.to.id)` to the Tests tab of the POST request would store the value. Then the GET request would resolve the `{{customerId}}` placeholder value. This is using a global variable but you could just use a different scope. – Danny Dainton Jul 09 '21 at 09:23
  • I already found the solution. any way thanks @DannyDainton – smith Jul 09 '21 at 10:23

0 Answers0