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.
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?:
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.