gpt4 book ai didi

java - 如何使用linkedin api获取公司数据?

转载 作者:行者123 更新时间:2023-11-30 02:53:04 26 4
gpt4 key购买 nike

我正在尝试从 linkedin 公司 api 获取数据。以下是我正在使用的 api。

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

当我运行代码时,我收到此 api 的 403 错误

错误:

Exception in thread "main" java.io.IOException: Server returned HTTP response code: 403 for URL: https://api.linkedin.com/v1/companies/162479/shares?format=json
at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1840)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1441)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:254)
at com.aail.linkedin.Linkedin.main(Linkedin.java:75)

我不知道 API 是否正常工作,但是我收到了 403 错误。

以下 API 是否仍然有效或已弃用?

Share API — https://api.linkedin.com/v1/people/~/shares
Companies API — https://api.linkedin.com/v1/companies/{id}

如果上述 API 正常工作,请分享示例代码示例。

最佳答案

根据公司 API 的新要求:

All calls to Companies API endpoints will require the authenticated user to be flagged as an administrator of the LinkedIn Company Page that is the target of the API call. You become the administrator of a page when you create it. If the page already exists, you will have to contact the existing administrator to grant admin access to other LinkedIn members.

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

https://developer.linkedin.com/support/developer-program-transition

关于java - 如何使用linkedin api获取公司数据?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38054042/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com