LinkedIn API“空oauth2访问令牌"错误 [英] LinkedIn API "Empty oauth2 access token" error

查看:125
本文介绍了LinkedIn API“空oauth2访问令牌"错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

很抱歉,如果这是一个问题,不适合堆栈溢出.

Sorry if this is question is not suitable for stackoverflow.

我已经从Linkedin API获得访问令牌.我正在尝试使用它,但是我不确定如何包括我的access_token.我找不到有关文档的任何示例.

I've got access token from Linkedin API. I am trying to use it however I am not sure how to include my access_token. I cannot find any example on documentation.

base_url = f'https://api.linkedin.com/v2/people?access_token={linkedin_key}&format=json'
requests.get(base_url).json()

此输出

    {'serviceErrorCode': 65604,
 'message': 'Empty oauth2 access token',
 'status': 401}

有人知道怎么了吗?谢谢.

does anyone know what's wrong? Thank you.

推荐答案

您需要传递的访问令牌参数是oauth2_access_token而不是access_token.

The access token param you need to pass is oauth2_access_token not access_token.

例如:

https://api.linkedin.com/v2/me?oauth2_access_token={linkedin_key}

我在文档中找不到它,已经有一段时间了,但这就是我在应用程序中使用它的方式.

I can't find it in the docs and it's been a while, but that's how I use it in my app.

这篇关于LinkedIn API“空oauth2访问令牌"错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆