2

我使用以下代码在 Python 中为我的应用程序获取访问令牌。

 CLIENT_SECRETS = 'client_secrets.json'
 MISSING_CLIENT_SECRETS_MESSAGE = "Missing Client Secrets"


 FLOW = flow_from_clientsecrets(os.path.join(os.path.dirname(__file__), CLIENT_SECRETS),
        scope=['https://www.googleapis.com/auth/drive','https://www.google.com/m8/feeds'],
        message=MISSING_CLIENT_SECRETS_MESSAGE)

 storage = Storage('drive.dat')
 credentials = storage.get()
 credentials = run(FLOW, storage)
 http = httplib2.Http()
 http = credentials.authorize(http)
 service = build("drive", "v2", http=http)

但是在获得访问令牌后,我应该如何使用 Python 的 gdata 客户端库检索 gmail 联系人列表?客户端库中的示例不使用 OAuth 身份验证,而是使用另一种方法。

4

0 回答 0