We needed to post LinkedIn updates in our gwt based application. LinkedIn-J is a java wrapper over LinkedIn API’s. We used this to post LinkedIn updates in our application.
We have also used signpost-core. It stands for simple oauth messages signing for java.
It exoposes a simple interface to sign HTTP requests using a given OAuth token and secret.
For getting this work we downloaded linkedin-j and signpost-core from the following location.
You can paste this jar in lib directory of your java based GWT application. Now our project is ready for using linkedin-j libraries.
Now the next step for calling any API method is to create the API client using the api key, api secret, access token, token secret.
final LinkedInApiClientFactory factory = LinkedInApiClientFactory.newInstance("consumer_key","consumer_secret"); final LinkedInApiClient client = factory.createLinkedInApiClient("access_key","access_token");
Thats it! now you can interact with linkedin.
All the methods in the library are divided into these categories.
1.To send updates on linkedIn profiles.
client.updateCurrentStatus("Your status");
2.Profile API
To fetch the profile of a person by ID.
Person profile = client.getProfileById(id); System.out.println("Name:" + profile.getFirstName() + " " + profile.getLastName()); System.out.println("Headline:" + profile.getHeadline()); System.out.println("Summary:" + profile.getSummary()); System.out.println("Industry:" + profile.getIndustry()); System.out.println("Picture:" + profile.getPictureUrl());
3.Connections API
To get connections of the current user:
Connections connections = client.getConnectionsForCurrentUser(); System.out.println("Total connections fetched:" + connections.getTotal());
4.Network Updates API
To fetch network updates of the current user:
Network network = client.getNetworkUpdates(EnumSet.of(NetworkUpdateType.STATUS_UPDATE)); System.out.println("Total updates fetched:" + network.getUpdates().getTotal());
I could not find consumer key and consumer secret using linkedln app.please help
linkedin-j is not maintained. The author hasn’t updated it in months and it’s sorely lacking features available in updates to LinkedIn’s APIs.
I got: {API Key, Secret Key, OAuth User Token, OAuth User Secret}, used them as {consumer_key, consumer_secret, access_key, access_token} not sure if this was correct but getting Error.
Can any one guide what is the correct use of these two lines:
factory = LinkedInApiClientFactory.newInstance(consumer_key, consumer_secret); // Correct ??
client = factory.createLinkedInApiClient(OAuth_User_Token, OAuth_User_Secret);// Correct ??
Can anyone please tell me the function to follow some one on linkedin in Linkedin-j api??
I am getting the following error, please suggest why?
Exception in thread “main” java.lang.NoClassDefFoundError: oauth/signpost/OAuthProvider
at com.google.code.linkedinapi.client.oauth.LinkedInOAuthServiceFactory.createLinkedInOAuthService(LinkedInOAuthServiceFactory.java:69)
at com.google.code.linkedinapi.client.oauth.LinkedInOAuthServiceFactory.createLinkedInOAuthService(LinkedInOAuthServiceFactory.java:57)
at com.google.code.linkedinapi.client.impl.BaseLinkedInApiClient.callApiMethod(BaseLinkedInApiClient.java:3751)
at com.google.code.linkedinapi.client.impl.BaseLinkedInApiClient.callApiMethod(BaseLinkedInApiClient.java:3725)
at com.google.code.linkedinapi.client.impl.BaseLinkedInApiClient.getProfileById(BaseLinkedInApiClient.java:1044)
at com.msceia.form.Test.main(Test.java:22)
Caused by: java.lang.ClassNotFoundException: oauth.signpost.OAuthProvider
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
how to get the company detail the user is admin
linkedin-j is now almost dead this project is last update is 7 year ago but still working some basic functionality.