title: Postman | API Chaining
body: <p>I have to automate these-</p>
  <ol>
  <li><p>Get a list of employees in the USA:</p>
  <p><strong>GET</strong> <code>/emps/usa</code></p>
  </li>
  <li><p>Get each user's details:</p>
  <p><strong>GET</strong> <code>/emps/empid</code></p>
  </li>
  </ol>
  <p>The first API returns data like this:</p>
  <pre><code>[
    {
      &quot;id&quot;: &quot;1&quot;,
      &quot;firstName&quot;: &quot;Tom&quot;,
      &quot;lastName&quot;: &quot;Cruise&quot;
    },
    {
      &quot;id&quot;: &quot;2&quot;,
      &quot;firstName&quot;: &quot;Maria&quot;,
      &quot;lastName&quot;: &quot;Sharapova&quot;
    },
    {
      &quot;id&quot;: &quot;3&quot;,
      &quot;firstName&quot;: &quot;James&quot;,
      &quot;lastName&quot;: &quot;Bond&quot;
    }
  ]
  </code></pre>
  <p>Now, for each employee I need to call a 2nd API to get details per <code>id</code>.</p>
  <p><strong>Problem</strong>: I created a collection with above mentioned API's.
  After the first API call, in Postman's <em>Tests</em> section I am reading the
  response values in a loop.
  My problem is: how can I read and hold data for each employee <code>id</code> and then
  call the 2nd API in the collection as many times I have received an employee
  <code>id</code>?
  Is there any way to call an API from Postman's <em>Tests</em> section?
  Or any other working idea?</p>