1
如何在Python中使用訪問令牌來調用Google+ API,目前我使用的是首先交換身份驗證網址然後交換憑證的流動方法。使用令牌致電Google + API
我的代碼是這樣的:
FLOW = OAuth2WebServerFlow(
client_id=client id,
client_secret=secret,
scope=scope,
user_agent=user_agent,redirect_uri=redirect_uri)
auth_uri = FLOW.step1_get_authorize_url()
credentials=FLOW.step2_exchange(code)
people_service = apiclient.discovery.build('people', 'v1',credentials=credentials)
connections = people_service.people().connections().list(resourceName='people/me').execute()
是的,我知道這段代碼工作正常。我需要做的是用訪問令牌調用谷歌apis,因爲我的android應用程序正在生成訪問令牌,並且我想使用該訪問令牌。 –