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:
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:
Can anyone link me to some sample Code about using LinkedIn JavaScript SDK to get our company Recent Updates?
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.
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?:
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:
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.
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
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With