Google Apps Script cUrl request
<p>I am pretty new to <code>Google Apps Script</code>. I am trying to create a script to pull data from a public API.</p>

<p>The API documenation indicates that the information can be accessed like this:</p>

<pre><code>curl -H "Content-Type: application/json" -X GET 
--header "X-PW-AccessToken:&lt;TOKEN&gt;" \
--header "X-PW-Application:developer_api" \
--header "X-PW-UserEmail:&lt;USER_EMAIL_ADDRESS&gt;" \
https://api.prosperworks.com/developer_api/v1/leads/2
</code></pre>

<p>I have this function setup in <code>Apps Script</code>:</p>

<pre><code>function myFunction() {
  var url = "https://api.prosperworks.com/developer_api/v1/leads/2";
  var headers = {
             "contentType": "application/json",
             "headers":{"X-PW-AccessToken": "&lt;TOKEN&gt;",
                        "X-PW-Application": "developer_api",
                        "X-PW-UserEmail": "&lt;USER_EMAIL_ADDRESS&gt;"}
             };

  var response = UrlFetchApp.fetch(url, headers);
  var text = response.getResponseCode();
  Logger.log(text);
}
</code></pre>

<p>When I run the code, the response appears to be empty but <code>text</code> is <code>200</code>.</p>

<p><a href="https://i.stack.imgur.com/dZz5J.png" rel="noreferrer"><img src="https://i.stack.imgur.com/dZz5J.png" alt="enter image description here"></a></p>

<p>I am able to make a call in <code>Postman</code> and get the expected <code>JSON</code> object. </p>

<p>What am I doing wrong in <code>Apps Script</code>? How do I access the <code>JSON</code> object?</p>