How to parse JSON response in Google App Script?

后端 未结 1 554
忘了有多久
忘了有多久 2021-01-06 14:12

I\'m using a Google AdWords/App Script and I got this response from DoubleClick Search. I\'m trying to parse it to put in a Sheet/ into an array to work with and I\'m not ha

1条回答
  •  伪装坚强ぢ
    2021-01-06 14:47

    It is similar to regular JavaScript. You get the JSON response with UrlFetchApp service and then access the properties using the dot notation.

    var response = authUrlFetch.fetch(url, options);
    var data = JSON.parse(response.getContentText());
    Logger.log(data.request.reportType);
    

    0 讨论(0)
提交回复
热议问题