Why would I get Login Required for Calendar List Q

2019-07-23 21:42发布

问题:

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().