Why would I get Login Required for Calendar List Query but not for Calendar Queries

不想你离开。 提交于 2020-01-15 14:14:00

问题


Why would:

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

work and return me the events for the requested query but:

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

Give me a Login Required error:

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

The SCOPE should give me access to both I believe:

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

回答1:


So I missed the http=decorator.http() from the execute().



来源:https://stackoverflow.com/questions/17064478/why-would-i-get-login-required-for-calendar-list-query-but-not-for-calendar-quer

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!