[英]Google Calendar API v3 PHP -> Trying to create new events into a single calendar
[英]Fetch Recurring events with google calendar api v3 in php
我正在使用谷歌日历api v3来获取日历事件。 但是如何获取所有重复发生的事件。 它只返回单个事件,有一些提示,如:DAILY; UNTIL = 20等。请帮我解决这个问题......
如果您使用的是Events:list API方法,请添加singleEvents=true
参数。 来自API文档 :
singleEvents
布尔
是否将重复事件扩展到实例中,并且仅返回单个一次性事件和重复事件的实例,而不是返回基础重复事件本身。 可选的。 默认值为False。
如果事件是重复发生的事件。 您需要使用事件ID调用API中的另一个函数,然后返回所有实例。
这意味着什么1)您从API获得正常的偶数列表。 2)然后,如果您发现具有ReccurenceID / Recurrence的事件,您可以使用EVENT ID调用以下内容。 您还可以在搜索正常事件时指定您想要的参数(几乎)
获取https://www.googleapis.com/calendar/v3/calendars/calendarId/events/eventId/instances
这是一篇很好的博客文章。 http://googleappsdeveloper.blogspot.com/2011/12/calendar-v3-best-practices-recurring.html
Google API页面位于: https : //developers.google.com/google-apps/calendar/v3/reference/events/instances
干杯
彼得
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.