Does Linkedin API provide a way to get the Recent Updates from our company's profile
Asked Answered
C

3

10

I am working on building our external web site for the company, and I want to show our company's LinkedIn profile's Recent Updates inside our web site. Currently when I access our company LinkedIn profile I can see those recent updates, which are available to public users as well (so users do not have to login to Linkedin to view those Recent Updates), as follows:

enter image description here

I read about the LinkedIn JavaScript API, and the capabilities it provides, and I already created a new LinkedIn Application and I set the required setting as mentioned on this link https://developer.linkedin.com/docs/getting-started-js-sdk but I got confused on how I need to use it and how the authentication will be managed.

I have the following questions:

  1. Can anyone link me to some sample Code about using LinkedIn JavaScript SDK to get our company Recent Updates?

  2. How the authentication for the LinkedIn JavaScript SDK work? I mean does the SDK allow getting our LinkedIn company profile's Recent Updates without require the user to be login to LinkedIn in advance? again our company Recent Updates can be viewed by any user who access our LinkedIn profile page (user does not have to be login to linked to view our profile and our Recent Updates). And since we are planning to show the Recent Updates inside our external web site, so we can not assume that any user who will view our web site is already login to LinkedIn to view those LinkedIn Recent Updates, or that the user has a LinkedIn account in the first place.

Edit

Based on the reply from @Craig Wayne. Now in my case I did not set any thing regarding the OAuth, since I only configure the required steps for the JavaScript as follow, so is this fine?:

enter image description here

Now I tried to use this link https://codepen.io/craigiswayne/pen/KGbqRq to test the Api call, where I entered the following info:-

Client ID: - "I entered out client id 14 digit"
REST URL:- "companies/<<our 8 digits id>>/updates?start=20&count=10&format=json"

but it keep trying to load the results, as follows:

enter image description here

Now final step inside our Sharepoint page I added the following code:

<script type="text/javascript" src="//platform.linkedin.com/in.js">
  api_key:                 14 digits code
  onLoad:                  LinkedINJSAPI.onLoad
  authorize:               true
  credentials_cookie:      true
  credentials_cookie_crc:  true
</script>
<script>
var LinkedINJSAPI = {
   onLoad: function(){
     IN.User.authorize(LinkedINJSAPI.request, this );
   },
   request: function(){
    var url = 'companies/<<>8 digits code>>/updates?start=20&count=10&format=json';
    IN.API.Raw(url).
      method('GET').
      result(function(result){
        console.log( JSON.stringify( result ) );
      }).
      error(function(error){
        console.error( error.message );
      });
   }
 }
</script>

where I got a popup from linked to enter a username and password,and after login, I got this error inside the browser console:

Member does not have permission to get company.

Cheju answered 22/10, 2018 at 23:41 Comment(0)
F
9

LinkedIn has an extensive API.

Does LinkedIn API provide a capability to get the company's Recent Updates?

Yes. LinkedIn API's provide the last 50 updates, including Job Postings, New Products, and Status Updates. Consult the API reference for company updates.

Can we securely integrate with the API using client side code (JavaScript)?

Yes. LinkedIn provides a JavaScript SDK. You should start by consulting their Getting Started with the JavaScript SDK guide, then look at their Company Pages guide.

Are API capabilities offered for free?

I can't find any documentation for pricing. It appears to be free with a rate limit throttle.

Can anyone link me to some tutorials & docs about integrating with LinkedIn apis using javascript code? and how we need to register with these APIs?

If you sign in to their developer site, you can create an application that will grant you the ability to make API calls.

Is there an RSS feed that can achieve these same goals?

There is an existing answer that outlines using RSS for displaying company updates.

Fredelia answered 23/10, 2018 at 0:3 Comment(15)
keep in mind that if you want to use the V2 api for linkedin requires you to get a partnership with linkedin.Natasha
@LarsHendriks can you advice more on your point? currently i only need to show our linkedin company profile recent updates inside our external web site.. so can i use V1 to achieve this or i have to use V2?Cheju
@Dan Bowling one question that just came to my mind, now since our Linkedin company profile allow any user to view its Recent Updates (no login is required), so can i use any Linkedin RSS feed to show the Recent Updates inside our external web site? as this will be a simpler appraoch rather than using LinkedIn APIs ? can you advice on this please ?Cheju
I'll update my answer with a link to another SO question that gets to that.Fredelia
You may also be interested in this answer regarding permissions to company updates vs the partner program: https://mcmap.net/q/1164067/-embedding-linkedin-company-updates-feedsFredelia
@DanBowling I tried to use the RSS feed for our profile, where i type the following url https://www.linkedin.com/biz/1******6/feed?start=0&v2=true, but i did not get any RSS item, instead i was redirected to our company's LinkedIn profile. also i have a software to get RSS feed results, and i type the RSS feed url https://www.linkedin.com/biz/1******6/feed?start=0&v2=true, but i got a message The requested RSS feed could not be displayed. Please verify the settings and url for this feed. so i am not sure if this LinkedIn RSS url mentioned inside your reply will actually work..Cheju
@testtest if all you need to do is show your recent updates. you can do it with the linkedin manage company page API ( this is a V1 api ). but if you are going to expand with certain other API calls look at the url and you will see V1 or V2. if it is a V2 it has a high, very high change you need to get a partnership.Natasha
@LarsHendriks ok thanks for the info, now i am planning to use the javascript SDK offered by LinkedIn to get the Recent Updates. but before starting to explore this in more details, i am not sure if i can achieve what i am looking for by simply using RSS feed? i mean since our Linkedin company profile allow any user to view its Recent Updates (no login is required), so can i use any Linkedin RSS feed to show the Recent Updates inside our external web site? as this will be a simpler appraoch rather than using LinkedIn APIs ?Cheju
@testtest i'm not sure about the RSS feed, i do know for sure that the API is able to do this.Natasha
@LarsHendriks so the javascript SDK offered by LinkedIn should be able to do so (get our profile recent updates)? second point now i try to use the javascript SDK (to get our profile basic info) but i faced some problems, i already wrote another question regarding this @ #52952116 not sure what i am doing wrong?Cheju
@LarsHendriks Now i am not sure how the authentication for the LinkedIn JavaScript SDK really work? I mean does the SDK allow getting our LinkedIn company profile's Recent Updates without require the user to be login ? again our company Recent Updates can be viewed for any user who access our LinkedIn profile page (user does not have to be login to linked to view our profile)??Cheju
@DanBowling now as mentioned on my above comment, i am still not sure how the authentication for the LinkedIn JavaScript SDK really work? I mean does the SDK allow getting our LinkedIn company profile's Recent Updates without require the user to be login to LinkedIn in advance? again our company Recent Updates can be viewed by any user who access our LinkedIn profile page (user does not have to be login to linked to view our profile and our Recent Updates)??Cheju
@testtest, From what I read, it looks like the JavaScript SDK works on the end users LinkedIn account. The documentation on the LinkedIn site is much more clear about using the REST API (which you could then serve as JSON to your front end JavaScript. See the section called "Required permission: rw_company_admin" on the "Get Company Updates" link I provided before (it is near the top of the page.)Fredelia
@DanBowling thanks again for your help. yes this what i have also concluded about the JS SDK, that it assume the users are already login to LinkedIn, and this will not work for our external web site, for the reasons mentioned earlier. now i will look at the REST API v1 capabilities, but not sure if the REST API needs any type of authentication? or i can get our LinkedIn profile's Recent Updates, even the user who is visiting our company external web site is not already login to LinkedIn?Cheju
@DanBowling second point, if the answer to the first question is Yes, then does the REST API v1 provide an API capability to get the LinkedIn profile Recent Updates ?Cheju
P
3

Add your LinkedIN JS SDK to your site, should look something like this:

<script type="text/javascript" src="//platform.linkedin.com/in.js">
  api_key:                 <!-- YOUR CLIENT ID (API KEY) HERE -->
  onLoad:                  LinkedINJSAPI.onLoad
  authorize:               true
  credentials_cookie:      true
  credentials_cookie_crc:  true
</script>

After which in your JavaScript add in the following:

 var LinkedINJSAPI = {
   onLoad: function(){
     IN.User.authorize(LinkedINJSAPI.request, this );
   },
   request: function(){
    var url = 'companies/1337/updates?start=20&count=10&format=json';
    IN.API.Raw(url).
      method('GET').
      result(function(result){
        console.log( JSON.stringify( result ) );
      }).
      error(function(error){
        console.error( error.message );
      });
   }
 }

You can see a working demo here...

https://codepen.io/craigiswayne/pen/KGbqRq

Paz answered 25/10, 2018 at 14:53 Comment(2)
thanks for the reply. can you please check my edit section on the original question ? where i updated my question based on your reply. now in my case i am trying to get the LinkedIn Recent Updates without requiring users to login to LinkedIn in advance,, so does your appraoch support this?Cheju
Unfortunately, it does not, sorry for this. If i do come across an alternative, i will gladly repostPaz
N
2

Member does not have permission to get company

can you confirm that the person that you login as has administrator permissions on the company page ?

if you login with the account on linkedin , do you see a manage option for the business page when you press on the "me" option next to the notifications.

because someone that wants to get company data has to be an administrator of the linkedin company page.

Natasha answered 26/10, 2018 at 10:28 Comment(8)
thanks for the reply.. interesting info.. so LinkedIn API does not only require the user to be already login to LinkedIn ,, it also require the user to be an admin of the LinkedIn account??... now for my requirement i want to show the LinkedIn's Recent Updates inside our external web site, so we can not assume the user is already login to LinkedIn, and if the user is already login, we can not guarantee that he is the admin of our company LinkedIn account !!!!!!!.. looks like showing our LinkedIn Recent Updates inside or external web site, is something that is unsupported??Cheju
correct, the problem is that the manage company page you can also add updates and thats why someone needs administrator permissions. there are 2 ways this can be done 1) get a partnership with linkedin and use client credential flow from oauth so you can login as the application instead of a user. 2) use a webscraper. im just not sure about the legal aspects of the second choice.Natasha
just to make sure we are on the same line.. i do not want to update our LinkedIn Recent Updates using API.. i only need to get these LinkedIn Recent Updates which are available to public users....Cheju
yes i get you want the updates. but another person can with the manage company api post updates on the page. thats why administrator rights are required to manage company pages including getting the recent updates.Natasha
@LarsHendrike so seems that showing those Recent Updates inside our web site is not a straight forward task. although i came across many web sites which are doing this ..not sure if i should cancel this requirement from our-side...Cheju
well it is easily possible if a serverside is added and client credential authentication flow is used to connect to linkedin then you can easily show the recent updates. if this is not an option i would definitly quit trying. because linkedin wont give you a solution.Natasha
@LarsHendrike so you mean even with server-side code, i will need to pass the user credentials ? i did not get your point correctly well it is easily possible if a serverside is added and client credential authentication flow is used to connect to linkedin then you can easily show the recent updates..Cheju
no. client credential only requires your applications client ID & Secret. it is used for application that do not require user interaction. like yours.Natasha

© 2022 - 2024 — McMap. All rights reserved.