I am using this OAuth library in Google Apps script https://github.com/googlesamples/apps-script-oauth2/blob/master/samples/Smartsheet.gs
and trying to make a call to Google Site Verification API, however I get following error while doing it-:
Request failed for https://www.googleapis.com/siteVerification/v1/token returned code 500. Truncated server response: {"error":{"errors":[{"domain":"global","reason":"backendError","message":"Backend Error"}],"code":500,"message":"Backend Error"}} (use muteHttpExceptions option to examine full response) (line 14, file "Service")
function run() {
var service = getiService();
if (service.hasAccess()) {
var url = 'https://www.googleapis.com/siteVerification/v1/token';
var result = UrlFetchApp.fetch(url, {
'headers': {
'Authorization' : 'Bearer ' + service.getAccessToken()
},
'method': 'GET',
"site": {
"identifier": "somedomainname.com",
"type": "INET_DOMAIN"
},
"verificationMethod": "DNS_TXT"
});
Logger.log(result)
Your help is appreciated. thank you