为什么我得到登录要求的日历列表查询,而不是日历查询



为什么:

events = calservice.events().list(calendarId='CAL_ID@group.calendar.google.com', singleEvents='true', showDeleted='false', timeMin='{:%Y-%m-%dT%H:%M:%SZ}'.format(now), timeMax='{:%Y-%m-%dT%H:%M:%SZ}'.format(nowplusonemin)).execute(http=decorator.http())
https://www.googleapis.com/calendar/v3/calendars/CAL_ID@group.calendar.google.com/events?timeMax=2013-06-12T11%3A04%3A09Z&showDeleted=true&alt=json&singleEvents=true&timeMin=2013-06-12T11%3A03%3A09Z

工作并返回请求查询的事件,但是:

calendar_list = calservice.calendarList().list(pageToken=page_token).execute()

给我一个Login Required错误:

<HttpError 401 when requesting https://www.googleapis.com/calendar/v3/users/me/calendarList?alt=json returned "Login Required">

SCOPE应该允许我访问这两个,我相信:

SCOPE='https://www.googleapis.com/auth/calendar'

所以我错过了execute()中的http=decorator.http()

最新更新