Skip to main content
function name is very case sensitive
Source Link
Martin Burch
  • 3k
  • 4
  • 34
  • 60

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

try {
    const response = UrlfetchAppUrlFetchApp.fetch(url, options);
    const data = JSON.parse(response.getContentText());
    Logger.log(data.request.reportType);
} catch (f) {
    Logger.log(f.message);
}

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

try {
    const response = UrlfetchApp.fetch(url, options);
    const data = JSON.parse(response.getContentText());
    Logger.log(data.request.reportType);
} catch (f) {
    Logger.log(f.message);
}

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

try {
    const response = UrlFetchApp.fetch(url, options);
    const data = JSON.parse(response.getContentText());
    Logger.log(data.request.reportType);
} catch (f) {
    Logger.log(f.message);
}
Added error handling
Source Link
Amit Agarwal
  • 11.3k
  • 1
  • 34
  • 44

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

vartry {
    const response = authUrlFetchUrlfetchApp.fetch(url, options);
var    const data = JSON.parse(response.getContentText());
    Logger.log(data.request.reportType);
} catch (f) {
    Logger.log(f.message);
}

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

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

try {
    const response = UrlfetchApp.fetch(url, options);
    const data = JSON.parse(response.getContentText());
    Logger.log(data.request.reportType);
} catch (f) {
    Logger.log(f.message);
}
Bounty Awarded with 250 reputation awarded by KyleMit
Source Link
Amit Agarwal
  • 11.3k
  • 1
  • 34
  • 44

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