title: Google Apps Script/URLFetchApp and using returned data
body: <p>I am very new to this, so please bear with me-- I have currently have an operational google apps script on the backend of a google sheet that is generated from Google Form answers. I am essentially setting up a ticket form in google forms that will trigger the data in the corresponding sheet to be sent via api call to our ticketing system. It works great, but I am trying to optimize it currently. The goal is to take the json response I get using:</p>
  <p><code>Logger.log(response.getContentText());</code></p>
  <p>which provides me the following info:</p>
  <p><code>Aug 9, 2020, 11:44:40 AM Info    {&quot;_url&quot;:&quot;https://testticketingsystem.com/REST/2.0/ticket/123456&quot;,&quot;type&quot;:&quot;ticket&quot;,&quot;id&quot;:&quot;123456&quot;}</code></p>
  <p>and send another API call to send data to that new ticket.</p>
  <p>Here's a code snippet:</p>
  <pre><code>var payload = { 
      &quot;Subject&quot;:  String(su),
      &quot;Content&quot;:  String(as),
      &quot;Requestor&quot;: String(em),
      &quot;Queue&quot;: String(qu),
      &quot;CustomFields&quot;: {&quot;CustomField1&quot;: String(vn), &quot;CustomField2&quot;: String(vb), &quot;CustomField3&quot;: 
       String(vg), &quot;CustomField4&quot;: String(av), &quot;CustomField5&quot;: String(ov), &quot;CustomField6&quot;: 
       String(sd)}
       }
  
  var options = {
        'method': 'post',
        &quot;contentType&quot; : &quot;application/json&quot;,
        'payload': JSON.stringify(payload),
        'muteHttpExceptions': true
         }
  
  var url = &quot;https://testticketingsystem.com/REST/2.0/ticket?token=****************&quot;;
  
  var response = UrlFetchApp.fetch(url,options);
  
  Logger.log(response.getContentText());
    
    } catch (error) {
      Logger.log(error.toString());
    }
    }
  </code></pre>
  <p>After the ticket is created, how do I script the use of that ID number as a variable into my next api call?</p>
  <p>Thank you!</p>