How to parse JSON response in Google App Script? How to parse JSON response in Google App Script? json json

How to parse JSON response in Google App Script?


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);