【发布时间】:2015-10-07 12:45:18
【问题描述】:
我想通过 REST API 查询 Google 日历。经过身份验证后,我在timeMin 和timeMax 之间request events。在以下情况下,距离“现在”还有 +/- 7 天(2015-09-30T14:19:46.595026+02:00 和 2015-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 个条目只要)。日期各不相同,但比现在更接近一月。
【问题讨论】: