python - LinkedIn JS API token 交换为 REST token

标签 python linkedin

我正在使用 Python python-oauth2。我在尝试交换我的代币时收到错误消息。这是代码片段:

consumer = oauth.Consumer(consumer_key, consumer_secret)

client = oauth.Client(consumer)

client.request(access_token_url, "POST", headers={'xoauth_oauth2_access_token':'XXXXXXXXXX'})
({'status': '400', 'content-length': '83', 'transfer-encoding': 'chunked', 'vary': 'Accept-Encoding', 'server': 'Apache-Coyote/1.1', '-content-encoding': 'gzip', 'date': 'Thu, 10 May 2012 22:28:38 GMT', 'nncoection': 'close', 'content-type': 'application/x-www-form-urlencoded;charset=UTF-8', 'www-authenticate': 'OAuth realm="https%3A%2F%2Fapi.linkedin.com", oauth_problem="parameter_absent", oauth_parameters_absent="oauth_token%26oauth_verifier"'}, 'oauth_problem=parameter_absent&oauth_parameters_absent=oauth_token%26oauth_verifier')

收到 400 响应:

oauth_problem="parameter_absent", oauth_parameters_absent="oauth_token%26oauth_verifier"

我无法获得 auth_verifier,因为这是 JSAPI 到 REST 的交换。我应该为通话做些不同的事情吗?

最佳答案

您没有将 xoauth_oauth2_access_token 作为 header 传递,而是作为查询参数传递。

关于python - LinkedIn JS API token 交换为 REST token ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10551523/

相关文章:

python - 修改前序树遍历为Python结构

python - 列表转换 - 就地

php - 为什么 LinkedIn v2 Share API 在任何 v2/shares 端点上都没有提供足够的权限错误?

button - LinkedIn 按钮间歇性出现

html - LinkedIn Open Graph 显示的错误图像

javascript - 从 AngularJS 访问 LinkedIn API

python - 检查方法是否已经在对象中?

python - 在 python 中从 pkcs7 中提取签名数据

python - 创建一个 Plotly 按钮以在 ScatterPlot 中隐藏/显示数据点

python - Django 从 linkedin 导入用户配置文件