【问题标题】:Google Calendar v3 API for Google Marketplace users适用于 Google Marketplace 用户的 Google Calendar v3 API
【发布时间】:2013-06-18 14:15:30
【问题描述】:

我们正在为 Google 市场用户开发一款与 Google 日历集成的应用。文档https://developers.google.com/google-apps/marketplace/best_practices 中的许多链接都不起作用。任何人都可以指点我为市场用户使用带有 RESTful Google Calendar API V3 的 2-Legged OAuth 工作吗? TIA, 里亚兹.A

【问题讨论】:

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


【解决方案1】:

下载以下支持 2legged oauth 的库

google-api-python-client==1.0beta4

然后确保您的清单包含更新的 calendar(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()

【讨论】:

    猜你喜欢
    • 2014-07-08
    • 1970-01-01
    • 2012-12-02
    • 2018-04-28
    • 2017-03-21
    • 1970-01-01
    • 2012-08-31
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多