0

我們正與谷歌日曆集成了谷歌購物網站用戶的應用工作。文檔https://developers.google.com/google-apps/marketplace/best_practices中的許多鏈接不起作用。任何人都可以指示我使用適用於marketplace用戶的RESTful Google Calendar API V3的雙腿OAuth? TIA, Riyaz .A谷歌日曆V3 API的谷歌市場用戶

+0

參見:HTTP ://stackoverflow.com/questions/17020076/admin-sdk-and-2-legged-oauth/17023358#17023358它指的是Admin SDK API,但是這個過程對於Calendar v3來說是一樣的。 –

+0

我們發佈了Google Apps Marketplace的新體驗([請參閱公告](http://googleenterprise.blogspot.com/2013/11/third-party-apps-now-easier-to-find-and.html) )。您可以在我們的[開發者文檔](https://developers.google.com/apps-marketplace/)中閱讀詳細信息。 在新的體驗中,我們已經從兩腳OAuth移開。您應該使用[服務帳戶](https://developers.google.com/accounts/docs/OAuth2ServiceAccount)。 [Drive](https://developers.google.com/drive/delegation)有很好的文檔可以幫助您指出正確的方向。 – jonathanberi

回答

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()