【问题标题】:Why does the Google Calendar API returns inconsistent events when time-constrained?为什么 Google Calendar API 在时间受限时会返回不一致的事件?
【发布时间】:2015-10-07 12:45:18
【问题描述】:

我想通过 REST API 查询 Google 日历。经过身份验证后,我在timeMintimeMax 之间request events。在以下情况下,距离“现在”还有 +/- 7 天(2015-09-30T14:19:46.595026+02:002015-10-14T14:19:46.594026+02:00 之间):

curl -H 'Authorization: Bearer the-token-I-got-and-which-is-OK' 'https://www.googleapis.com/calendar/v3/calendars/something_correct@group.calendar.google.com/events?timeMax=2015-10-14T14%3A19%3A46.594026%2B02%3A00&timeMin=2015-09-30T14%3A19%3A46.595026%2B02%3A00'  

结果,我得到了两个事件 - 但时间不对:

{
 "kind": "calendar#events",
(...)
 "items": [
  {
   "kind": "calendar#event",
(...)
   "start": {
    "dateTime": "2015-01-09T07:00:00+01:00",
    "timeZone": "Europe/Paris"
   },
   "end": {
    "dateTime": "2015-01-09T07:15:00+01:00",
    "timeZone": "Europe/Paris"
   },
(...)
  },
  {
   "kind": "calendar#event",
(...)
   "start": {
    "dateTime": "2015-01-10T07:30:00+01:00",
    "timeZone": "Europe/Paris"
   },
   "end": {
    "dateTime": "2015-01-10T07:45:00+01:00",
    "timeZone": "Europe/Paris"
(...)
  }
 ]
}

一月有两个活动。它们确实存在于日历中,并且是该日历中的前两个事件(它们是周期性事件,没有结束日期)。

为什么时间限制无效?

如果我删除时间限制,我会收到更多事件,但仍然不是全部(我想这可能是 API 的限制,需要一些滚动 - 我没有调查这一点,因为我的时间限制将匹配大约 10 个条目只要)。日期各不相同,但比现在更接近一月。

【问题讨论】:

    标签: google-calendar-api


    【解决方案1】:

    我缺少singleEvents 参数,默认为False

    是否将循环事件扩展为实例并只返回 单个一次性事件和重复事件的实例,但不是 潜在的重复事件本身。可选的。默认是 假的。

    【讨论】:

      猜你喜欢
      • 2013-12-04
      • 2014-06-18
      • 2015-03-14
      • 1970-01-01
      • 2014-04-07
      • 1970-01-01
      • 2016-07-18
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多