简体   繁体   English

如何在无需登录的情况下从linkedin获取公司数据?

[英]How to get company data from linkedin without being required to login?

My end goal is to display the latest LinkedIn post for a company on their company website.我的最终目标是在公司网站上显示公司的最新 LinkedIn 帖子。 I've managed to use the LinkedIn API to pull in updates.我已经设法使用 LinkedIn API 来获取更新。 However, I have to be logged into the admin LinkedIn account in order for the data to load.但是,我必须登录到管理员 LinkedIn 帐户才能加载数据。 If i'm not logged in, it doesn't load anything.如果我没有登录,它不会加载任何东西。 The general public needs to be able to see this feed on the website so that won't work.公众需要能够在网站上看到此提要,这样才行不通。

Is this even possible with the API?这甚至可以通过 API 实现吗? Did I do something wrong?我做错什么了吗? Is another method I can try?我可以尝试另一种方法吗?

There's 2 ways to get this, both of which need oAuth login.有两种方法可以得到这个,这两种方法都需要 oAuth 登录。 You don't need to be a company admin.您无需成为公司管理员。 You can use the company share API to fetch their latest post by company id.您可以使用公司共享 API 按公司 ID 获取他们的最新帖子。 You'd do this on the server-side and serve up the update to the user.您将在服务器端执行此操作并将更新提供给用户。

API Reference: https://developer.linkedin.com/docs/company-pages#company_updates API 参考: https ://developer.linkedin.com/docs/company-pages#company_updates

Example http request using curl :使用curl的示例 http 请求:

curl "https://api.linkedin.com/v1/companies/1337/updates?oauth2_access_token=your-app-oauth-token-here&start=0&count=1&format=json"

You can also do this via the Javascript API but that means the user will login to LinkedIn and use their oauth to fetch the company's latest post.您也可以通过 Javascript API 执行此操作,但这意味着用户将登录 LinkedIn 并使用他们的 oauth 来获取公司的最新帖子。

There's also a v2 api that is available but this should work for what you're describing.还有一个可用的 v2 api,但这应该适用于您所描述的内容。

Best wishes, RV最好的祝愿,房车

Instead of manually logging in to LinkedIn app, you have to authenticate via OAuth login ( more about OAuth protocol ) where you have a client id and secret and you are authenticated based on this.您必须通过 OAuth 登录(有关 OAuth 协议的更多信息)进行身份验证,而不是手动登录 LinkedIn 应用程序,在该登录中您有一个客户端 ID 和密码,并基于此进行身份验证。

This info is generally passed in request headers and after authentication you can consume API data.此信息通常在请求标头中传递,并且在身份验证后您可以使用 API 数据。

More can be seen here Managing company pages: LinkedIn更多可以在这里看到管理公司页面:LinkedIn

这是一个老问题,但您也可以使用此第三方 api 获取数据而无需登录: https ://rapidapi.com/williambarberjr/api/linkedin-company-data

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM