LinkedIn

This is a short guide on how to create a robot which accesses LinkedIn through the REST API, which can be used to read and write to LinkedIn accounts.

First, log into http://developer.linkedin.com with your LinkedIn account, or create a new account if necessary. Hover over your name in the upper right corner and click "API Keys" in the menu that appears.

Then, click "Add New Application".

A configuration screen now appears for the new app. Fill in the form with relevant information. One of the fields is called "OAuth Accept Redirect URL". Write the OAuth callback URL in this field. The callback URL is the path OAuthCallback under the folder in which the Management Console is deployed. For instance, if running with an embedded Management Console, it runs at http://localhost:50080/ or similarly http://127.0.0.1:50080/. In the latter case, the callback URL is specified to http://127.0.0.1:50080/OAuthCallback.

After reading and accepting the LinkedIn API Terms of Use and adding the application, a page with Application details is opened. On this page it is important to take note of the API Key and Secret Key which will be used as Consumer Key and Consumer Secret in the Management Console later on. The page also gives you a User Token and User Secret, but we can ignore these as we will be creating our own.

Now, open the Management Console. Make sure to open the Management Console at the URL specified for the app. That would be http://127.0.0.1:50080 for the information used above. Then navigate to the OAuth Repository and click "New Application".

Select a name for the new application and choose LinkedIn as the service provider. Consumer Key and Consumer Secret should respectively be set to the API Key and Secret Key noted earlier. The Callback URL should already be correctly stated.

In the Scope field, we state the kinds of permissions required from the app user. In the picture below two different permissions have been requested: "r_basicprofile", which gives permission to read basic profile information and "r_emailadress", giving permission to access the user's email address. For more scope options please consult https://developer.linkedin.com/documents/authentication#granting.

After being saved, the application appears in the repository. Click on the icon under "Add User" to add a user to the application.

Choose a name for the user and click next.

Now, click the authorization link.

This will open a page where the app will request permission to access your LinkedIn account, specifying the two permissions requested.

Authorizing the app will forward you to the OAuth callback page of the Management Console.

Close the OAuth callback page, returning to the Management Console. Click Next in the wizard and you will see the access token and access token secret granted for accessing LinkedIn on the user's behalf. Copy these tokens into a notepad, since they will not be accessible later for security reasons.

After clicking Finish, you should now see a user in the Users section of the OAuth tab.

Now, open Design Studio and create a new robot or open the robot you would like to access the LinkedIn API. For the robot to be able to use the LinkedIn API, make sure that it has an input variable of the complex type "OAuthCredentials". The variable should have "LinkedIn" as the service provider name. Also, input the access token and access token secret along with the API Key and Secret Key noted earlier. The latter two should be used as consumer key and consumer secret respectively.

Then, make sure to configure the robot to use OAuth credentials.

The robot should now be able to access the LinkedIn API. As an example try typing http://api.linkedin.com/v1/people/~ in the address bar of the browser view and pressing Enter. This should return an xml page with basic user information. Also try http://api.linkedin.com/v1/people/~/email-address, which returns the user email address.

To learn more about the LinkedIn REST API visit https://developer.linkedin.com/rest. Once a robot has been built, it is possible to schedule execution of the robot in the Management Console.