0

我正在使用 FLOW api 在 Google 日历版本“v3”中授权通过我的应用程序访问 Google 日历。

身份验证已完美完成,但当时尝试从该人的 Google 日历访问该特定人的事件时出现以下错误。

HttpError: <HttpError 404 when requesting https://www.googleapis.com/calendar/v3/calendars/primary/events?alt=json&key='DEVELOPER_KEY' returned "Not Found">

虽然对此进行了很多观察,但无法解决相同的错误。

我正在使用以下代码片段从 Google 日历中获取事件。

events = service.events().list(calendarId='primary').execute() #fetch out events for first time
while True:
    for event in events.get('items', []):
        print event['summary']
    page_token = events.get('nextPageToken') #check if any event present in next page of the calendar
    if page_token:
        events = service.events().list(calendarId='primary', pageToken=page_token).execute()
    else:
        break
4

1 回答 1

0

将字符串 'primary' 替换为用户的完整电子邮件地址:

events = service.events().list(calendarId='myuser@gmail.com').execute() #fetch out events for first time
while True:
    for event in events.get('items', []):
        print event['summary']
    page_token = events.get('nextPageToken') #check if any event present in next page of the calendar
    if page_token:
        events = service.events().list(calendarId='primary', pageToken=page_token).execute()
    else:
        break
于 2013-01-15T15:27:51.357 回答