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

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

问题描述

对不起,如果这个问题不适合 stackoverflow.

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天全站免登陆