title: Correct Approach to GET JSON Data From Multiple REST Endpoints
body: <p>So, I am trying to determine the best way to go about getting/parsing JSON data from an existing web API.</p>
  
  <p>What I mean is, given an endpoint like: </p>
  
  <p><a href="https://example.com/api/projects" rel="nofollow noreferrer">https://example.com/api/projects</a> (not real)</p>
  
  <p>which returns JSON structured like:</p>
  
  <pre><code>{
      "count": 4424,
      "results": [
          {"id": 2718, "name": "fox", "location": "Omaha"}, 
          {"id": 2719, "name": "bear", "location": "Miami"}
      ]
  }
  </code></pre>
  
  <p>I need to then get a list of those id values in order to get the JSON from the subsequent endpoint which makes use of the project ID: </p>
  
  <p><a href="https://example.com/api/projects/" rel="nofollow noreferrer">https://example.com/api/projects/</a><strong>[id]</strong>/resources (not real)</p>
  
  <p>and returns JSON structured like:</p>
  
  <pre><code>{
      "quota_cpus": 2,
      "active_cpus": 1,
      "quota_memory": 16384,
      "active_memory": 0
  }
  </code></pre>
  
  <p>What I was thinking was that I would use OKHTTP3 to make a REST call to retrieve the project IDs and store them in a java object called Project.</p>
  
  <p>Then I was going to loop through the list and make another REST call to retrieve the list of resources for each individual project and store that in a new object called ProjectResources.</p>
  
  <p>My questions are:</p>
  
  <ul>
  <li>Does that seem like the right approach to take? </li>
  <li>What better alternatives would you suggest? </li>
  <li>And should I make these synchronous or asynchronous calls?</li>
  </ul>