我们正在为谷歌市场用户开发一个与谷歌日历集成的应用程序。文档https://developers.google.com/google-apps/marketplace/best_practices中的许多链接不起作用。有人能指出我在2腿OAuth与RESTful谷歌日历API V3为市场用户工作吗?蒂雅,Riyaz。
下载下面支持2legged oauth的库
1.0 beta4 google-api-python-client = =
并确保您的清单包含更新的日历(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()