【发布时间】:2017-09-15 05:32:53
【问题描述】:
我在 Google Apps 脚本 https://github.com/googlesamples/apps-script-oauth2/blob/master/samples/Smartsheet.gs 中使用这个 OAuth 库
并尝试调用 Google Site Verification API,但是在执行此操作时出现以下错误-:
https://www.googleapis.com/siteVerification/v1/token 的请求失败,返回代码 500。截断的服务器响应:{"error":{"errors":[{"domain":"global","reason":"backendError","message":" Backend Error"}],"code":500,"message":"Backend Error"}}(使用 muteHttpExceptions 选项检查完整响应)(第 14 行,文件“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)
感谢您的帮助。 谢谢
【问题讨论】: