我只想获得日历列表,其所有者以及他们的忙/闲状态。
我已根据this guide添加了服务帐户,我可以从单个用户处获取日历。但是我想在整个领域做这个。
f = file('key.p12', 'rb')
key = f.read()
f.close()
credentials = SignedJwtAssertionCredentials('xxx@developer.gserviceaccount.com',
key,
scope='https://www.googleapis.com/auth/calendar.readonly',
user_agent='bot',
sub='john@example.cz') #I want calendars from everyone
http = httplib2.Http()
http = credentials.authorize(http)
service = build('calendar', 'v3', http=http)
lists = service.calendarList().list(pageToken=None).execute(http=http)
pprint.pprint(lists)