18

我试图弄清楚如何访问LinkedIn 上的任何公司资料。例如,LinkedIn 本身的REST 端点 API是:

https://api.linkedin.com/v1/companies/1337?format=json

样本响应为:

{
  "id": 1337,
  "name": "LinkedIn"
}

但是,在rw_company_admin启用 OAuth2 进行身份验证后,我的应用程序返回:

{
  "errorCode": 0,
  "message": "Member 206xxxxxx does not have permission to get company 1337",
  "requestId": "G6LNMCEZO8",
  "status": 403,
  "timestamp": 1432358171348
}

这一直持续到最近。

该文档确实指出 “为了执行以下任何公司页面管理 API 调用,发出请求的经过身份验证的 LinkedIn 用户必须是目标公司的管理员。” 令人困惑的是,它还说 “以下端点是唯一可以使用的端点……公司 API — /v1/companies/{id}

但是,我的目标不是以管理员身份管理公司,而是向用户展示公司的简要输出。如何获取公司信息?

4

3 回答 3

13

看起来他们关闭了该功能。

请参阅https://developer.linkedin.com/support/developer-program-transition

公司 API 的新要求

对公司 API 端点的所有调用都需要将经过身份验证的用户标记为作为API 调用目标的 LinkedIn 公司页面的管理员。创建页面时,您将成为页面的管理员。如果该页面已存在,您必须联系现有管理员以授予其他 LinkedIn 成员管理员访问权限。

Your API call will return a 403 Forbidden error if you do not have the appropriate admin permission to interact with the target company.

And in the first line,

On February 12th 2015 we announced a series of changes to our developer program. These changes have now begun to take affect and will be rolled out to the entire LinkedIn application base between May 12th - May 19th, 2015.

So we are out of luck.

于 2015-05-28T10:32:34.357 回答
6

For accessing the company details from LinkedIn you must make a authenticated request(You must be the administrator of the company). For authenticated calls follow this link. https://developer.linkedin.com/docs/oauth2#!

Anyway, you must have the permission rw_company_admin to access the company details. For that, you must check Default Application Permissions in your App settings and also important to note that when you request for an Authorization Code you must specify the scope.

Use this method to get an authorization code for a company

https://www.linkedin.com/oauth/v2/authorization?response_type=code&client_id=123456789&redirect_uri=https%3A%2F%2Fwww.example.com%2Fauth%2Flinkedin&state=987654321&scope=rw_company_admin

于 2016-09-16T17:21:15.240 回答
0

I had issues with this as well even though I was definitely a company admin. Once I added that company as my current place of work on my profile, the API started to respond as expected.

于 2018-08-02T10:19:57.397 回答