【发布时间】:2015-05-20 05:41:07
【问题描述】:
- 我想使用 Google CAL API v3 观看多个日历,从而将所有这些事件从这些日历更新到主日历,所以我需要使用 WATCH/PUSH 通知 以便无论何时是那些 cal 中的一个新事件,这些事件应该在我的主日历中自动推送/创建。
- 但是,我面临以下问题:在 APIs Explorer 下。大多数服务返回 200 OK,除了 Watch 请求不起作用。
服务 > Calendar API v3 > calendar.events.watch
我收到了以下请求和响应
请求
POST https://www.googleapis.com/calendar/v3/calendars/mailid%40domain.com/events/watch?key={YOUR_API_KEY}
{
}
回应
400 OK
{
"error": {
"errors": [
{
"domain": "global",
"reason": "required",
"message": "entity.resource"
}
],
"code": 400,
"message": "entity.resource"
}
}
然后我按照以下 google 文档进行操作 https://developers.google.com/google-apps/calendar/v3/push
注册您的域:
第 1 步:验证您是否拥有该域
第 2 步:注册您的域
我在 Google 网站管理员工具中验证了我的域/通知。 我经过验证的域如下所示:
并在 Google Developer Console 的 PUSH 下的 webhook 中添加了我的域名,如 doc 中所述。
这里有什么我遗漏的吗,请问我的域的 SSL 证书是否存在问题,我如何至少在 API 资源管理器中进行测试,以便我得到返回码 200 OK。之后,我需要通过 Google Apps 脚本实现这个push/WATCH。
是否有任何关于应用程序脚本使用推送通知的文档。
任何提示,提示都会对我有所帮助,在过去的 1 周里,我已经厌倦了这种尝试和错误的方法。
【问题讨论】:
标签: google-apps-script push-notification google-api google-calendar-api