【问题标题】:Using python to connect to Docebo api via Oauth2使用python通过Oauth2连接Docebo api
【发布时间】:2017-11-27 06:12:58
【问题描述】:

这是我目前所拥有的。没有真正的成功。尝试检索令牌,但似乎没有任何效果。只是返回一大堆字符。

import requests
import json

auth_url = "http://learn.ZZZZZZZ.com/oauth2/authorize"

#credential
auth_client_id = "BBBBBBBBBBBBBBBBBBBBBBBB"
auth_client_secret = "YYYYYYYYYYYYYYYYYYYYY"  

payload={'grant_type':'client_credentials', 'client_id':auth_client_id,'client_secret':auth_client_secret}
headers={'Accept':'application/json', 'Content-Type':'application/x-www-form-urlencoded'}

response = requests.post(auth_url,headers=headers,data=payload)
response.text

【问题讨论】:

    标签: python api oauth-2.0


    【解决方案1】:

    使用令牌端点获取访问令牌。
    auth_url = "http://learn.ZZZZZZZ.com/oauth2/token"

    Docebo API documentation

    【讨论】:

      猜你喜欢
      • 2017-07-03
      • 1970-01-01
      • 1970-01-01
      • 2015-11-28
      • 1970-01-01
      • 1970-01-01
      • 2019-12-04
      • 2014-06-22
      • 1970-01-01
      相关资源
      最近更新 更多