【问题标题】:Google Apps Script suddenly lost the access to Calendar APIGoogle Apps 脚本突然失去对日历 API 的访问权限
【发布时间】:2019-06-17 07:25:02
【问题描述】:

我有一个 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 上检查了配额,但绝对没有超出那里设置的限制。

【问题讨论】:

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


【解决方案1】:

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

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

【讨论】:

    猜你喜欢
    • 2010-12-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-07-05
    • 1970-01-01
    相关资源
    最近更新 更多