适用于Google Marketplace用户的Google Calendar v3 API

时间:2013-06-18 14:15:30

标签: google-api google-calendar-api google-apps google-apps-marketplace 2-legged

我们正在开发一款适用于谷歌市场用户的Google Calendar Integration应用。文档https://developers.google.com/google-apps/marketplace/best_practices中的许多链接无法正常工作。任何人都可以指向我为市场用户使用RESTful Google Calendar API V3进行2-legged OAuth工作? TIA, Riyaz .A

1 个答案:

答案 0 :(得分:0)

下载支持2legged oauth的以下库

google-api-python-client==1.0beta4

并确保您的清单包含更新的日历(v3)范围

from apiclient.oauth import TwoLeggedOAuthCredentials
from apiclient.discovery import build
import httplib2

credentials = TwoLeggedOAuthCredentials(OAUTH_CONSUMER_KEY,OAUTH_CONSUMER_SECRET,'referer')
credentials.requestor = user_email
http = httplib2.Http()
http = credentials.authorize(http)
calendar_service = build('calendar', 'v3', http=http)
list = calendar_service.events().list(calendarId="primary").execute()