我直接从Linkedin's V2 API Documentation按照说明获取访问令牌,然后尝试通过 endpoints https://api.linkedin.com/v2/me获取基本用户信息,但它只是返回以下错误:
{
"serviceErrorCode": 100,
"message": "Not enough permissions to access /me GET ",
"status": 403
}
我尝试使用相同的代码到API等效的版本1(https://api.linkedin.com/v1/people/~?format=json),它的工作原理 .
v1和v2文档都重定向到相同的URL(https://developer.linkedin.com/docs/oauth2),这是有道理的,因为它们都通过OAuth 2.0进行身份验证 .
我查看了我的应用程序的权限,它们看起来不错(我尝试使用r_basicprofile,* r_emailaddress *,两者都有,并且当我请求访问授权代码时以及在Linkedin Dashboard中的应用程序设置中,所有权限都是显式的) .
我想知道是否有一些我缺少的东西,或者我在做这项工作的过程中做错了 .
1 回答
LinkedIn API是私有的 . 您必须在https://business.linkedin.com/marketing-solutions/marketing-partners/become-a-partner/marketing-developer-program(或其他计划之一)请求他们的授权 .