我一直想整天想弄清楚如何从我的应用程序“重新水化”循环事件的实例。让循环事件的实例保持同步
让我解释一下流真正快速:
- 用户授权访问我的应用程序来编辑自己的日历
- 的应用程序建立一个经常性事件
- 该应用程序订阅了
/watch
终点为日历
到目前为止很好,现在当创建者将该事件移动到另一个时间时,我收到了有关webhook url的通知,这很好(很好,有点),它OKS这样的:
'x-goog-channel-id': 'my_specified_channel_id',
'x-goog-channel-expiration': 'Thu, 29 Sep 2016 12:58:10 GMT',
'x-goog-resource-state': 'exists',
'x-goog-message-number': '333384',
'x-goog-resource-id': 'some-resource-id', // This id apparently has nothing to do with any resources I know of
'x-goog-resource-uri': 'https://www.googleapis.com/.../resource-uri'
所以我的身影,我可以打电话给https://www.googleapis.com/calendar/v3/calendars/primary/events/some-resource-id
并获得更新的资源,但resource-id
似乎并不具有任何与日历中的任何事件,也不是它的ID的日历本身(我使用'primary'
关键字)
所以我想,我可以作为解决方案使用https://www.googleapis.com/calendar/v3/calendars/primary/events/recurring-event-id/instances
端点获取周期性事件的所有实例,但现在移动的事件不再是零件的有效载荷了。我猜测谷歌从父事件中移除事件,因为它不会在一天中的同一时间发生(我无法在任何地方确认此事)?
那么,我要问的是:
- 难道我解释
x-goog-resource-id
错了吗? - 有人可以确认,一旦事件从谷歌日历应用程序编辑它失去其与经常性父事件的关系?
根据此[文档](https://developers.google.com/google-apps/calendar/v3/push#understanding-the-notification-消息格式),X-Goog-Resource-ID是一个不透明的v alue标识所监视的资源。这个ID在各个API版本中是稳定的。 查看此[link](https://developers.google.com/google-apps/calendar/recurringevents)以了解有关Reccuring Events的更多信息。 – KENdi