【发布时间】:2014-09-29 13:50:26
【问题描述】:
我只想获取日历列表、它们的所有者以及它们的空闲/忙碌状态。
我已经根据this guide添加了Service Account,我可以从单个用户那里获取日历。但我想在整个域范围内执行此操作。
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)
【问题讨论】:
标签: python calendar google-apps