Google Apps脚本突然失去了对Calendar API的访问权限

时间:2019-01-23 16:33:13

标签: google-apps-script permissions google-calendar-api

我有一个Google Apps脚本,可以从我的Google日历中检索事件并进行处理。 大约3-4个小时前,它就可以正常工作,但是在某个时候,它只是停止了工作。

错误发生在行:

var calendar = CalendarApp.getOwnedCalendarsByName('calendar name')[0];

错误显示“脚本无权执行此操作。必需的权限(https://www.googleapis.com/auth/calendar || https://www.googleapis.com/auth/calendar.readonly || https://www.google.com/calendar/feeds)”。

我检查了Google Calendar API的配额,但绝对没有超出那里设置的限制。

1 个答案:

答案 0 :(得分:0)

正确的解决方案是按清单所述在清单文件中明确指定所需的权限:"Authorisation is required to perform that action" message, even after clicking "Allow"

只需将错误中提到的URL添加到oauthScopes数组。

相关问题