【问题标题】:How to fetch all the events from multiple google calendar for a single google account?如何从单个谷歌帐户的多个谷歌日历中获取所有事件?
【发布时间】:2021-11-20 12:11:16
【问题描述】:

我正在开发一个应用程序来显示来自谷歌日历的所有事件。有什么方法可以在一个 API 中从我拥有的所有日历中获取所有事件?

我查看了 google API 文档并找到了这个 API:

https://www.googleapis.com/calendar/v3/calendars/calendarId/events

在这里我必须选择一个日历来获取事件,但我有超过 6 个 Google 日历用于单个 Gmail 帐户,我真的不想为所有日历使用 for 循环。那么有没有办法在一个 API 调用中从所有日历中获取所有这些事件?

提前谢谢你

【问题讨论】:

  • I really don't want to use a for loop for all calendars...不幸的是,没有其他选择。如果有,您已经可以在文档中看到
  • 我不确定是谁投了这个票,但是关于 Google 日历 API 的问题怎么可能与软件相关?

标签: php google-api google-calendar-api google-developers-console google-people-api


【解决方案1】:

为此,您可以使用Events.list

要求您发送一个 calendarId。要使该方法起作用,它需要知道您希望查看哪个日历的事件。

 https://www.googleapis.com/calendar/v3/calendars/calendarId/events

没有其他方法可以检索日历事件。您需要遍历每个日历。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2013-12-13
    • 2015-01-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多