title: TypeError: response.getContentText is not a function app script
body: <p>right now i am working on a community connector for Google Data studio, halfway on it, but 
  when i move to get the data on my project i get a error:
  TypeError: response.getContentText is not a function  app script</p>
  
  <p>already tried to disable v8 runtime on app script, other "get" functions but the error is the same, it calls response."anything" a non function...</p>
  
  <p>i am a little newbie at JS/AppScript... any clues or examples i can look? since now thanks.</p>
  
  <pre class="lang-js prettyprint-override"><code>function fetchDataFromApi(request){
    var url = '***************'
    var options = {
      headers:{
        'Api-token' : '******************'
      }
    }
    var response = UrlFetchApp.fetch(url, options);
  
    return JSON.parse(response.getContentText());
  }
  
  function formatData(response, requestedFields){
   var item = response.getContentText().shift();
    var row = requestedFields.asArray().map(function(field){
      switch (field.getId()){
        case 'analytics_campaign_name':
          return item.analytics_campaign_name;
  
        default:
          return '';
      }
    });
    return [{values: row}];
  }
  </code></pre>
  
  <p>Both these functions are getting called inside <code>getData()</code>:</p>
  
  <pre class="lang-js prettyprint-override"><code>function getData() {
    // Rest of code
    try { 
      console.log('Fetch Data Start'); 
      var apiResponse = fetchDataFromApi(request); 
      var data = formatData(apiResponse, requestedFields); 
    } catch(e){ 
      dataS.newUserError() 
        .setDebugText('Error Fetching data from API. err: ' + e) 
        .setText('Connector has ended whithout gettig the data.') 
        .throwException(); 
    }
    // Rest of code
  }
  </code></pre>
  
  <p>i have change the function response in this way.</p>
  
  <pre><code>    function fetchDataFromApi(request){
        *******
        }
        var response = JSON.parse(UrlFetchApp.fetch(url, options).getContentText());
        console.log(response);
        return response;
      }
  
  </code></pre>
  
  <p>console.log(response); returns me data from api fine, but on my data studio its now only give me null fields...</p>
  
  <p>inside formatData() the response parameter is still undefined when i log it...</p>
  
  <pre class="lang-js prettyprint-override"><code>    function formatData(response, requestedFields){
        console.log('response: ', response);
        console.log('resquestedFields: ', requestedFields);
         var item = response;
         var row = requestedFields.asArray().map(function(field){
          switch (field.getId()){
            case 'analytics_campaign_name':
              return item.analytics_campaign_name;
  
            default:
              return '';
          }
        });
        return [{values: row}];
      }
  </code></pre>