Complete guide on LinkedIn API 2024 | AeroLeads

The LinkedIn API, also known as the REST API, is the heart of all programmatic interactions with LinkedIn. All other methods of interaction, such as JavaScript and the Mobile SDKs, are simply wrappers around the REST API to provide developers with an added level of convenience. Hence, even if you are doing mobile or JavaScript development, it’s still worth taking the time to familiarize yourself with how the REST API works and what it can do for you.

How is LinkedIn useful?

LinkedIn is a social network with over 460 million + users worldwide. It’s one of the major social networks (along with Facebook, Twitter, and Google+). We at AeroLeads consider it a gold mine of sales information! Hence, perhaps that’s why nearly every B2B salesperson uses LinkedIn to prospect and convert connections into clients. Also, like many sales products, it’s priced so that closing a deal or two completely justifies the cost.linkedin api guide

LinkedIn API

Bring the power of the world’s largest professional network to your apps. By using the LinkedIn API, you can access several LinkedIn services. LinkedIn has examined the value of offering an open API to all developers and found the program not in the company’s best interest. It would be restricting broad LinkedIn API use to a few simple use cases, including those specified by LinkedIn itself –

  1. Allowing members to represent their professional identity via their LinkedIn profile using the Profile API.
  2.  Enabling the members to post certifications directly to their LinkedIn profile with the Add to Profile tools.
  3.  It also helps members share professional content with their LinkedIn network from across the Web, leveraging the Share API.
  4.  Enabling companies to share professional content to LinkedIn with the Company API.
  5.  Reduce friction and get more sign-ups by allowing users to sign in with LinkedIn instead of creating a new account.
  6.  Minimize the cost and time of implementing your login, profile management, password change and recovery workflows.
  7.  Personalize your sites and apps with up-to-date member profile data.

How to use LinkedIn API?

Before proceeding with using the LinkedIn API, one must first know the various data formats and understand the request throttling processes.

Requesting data from the APIs –

Unless otherwise specified, all of LinkedIn’s APIs will return the information you request in the XML data format.

For example :

GET
https://api.linkedin.com/v1/people/~
 
sample response
<?xml version="1.0" encoding="UTF-8"?>
<person>
  <id>1R2RtA</id>
  <first-name>Frodo</first-name>
  <last-name>Baggins</last-name>
  <headline>Jewelery Repossession in Middle Earth</headline>
  <site-standard-profile-request>
    <url>https://www.linkedin.com/profile/view?id=…</url>
  </site-standard-profile-request>
</person>

If it is more convenient for your application to work with data in JSON format, you can request that APIs return you the JSON data using one of the following methods:

• Add a format=json URL argument to the end of your API call.

• Add this HTTP header to your API call: x-li-format: json

For example :

GET
https://api.linkedin.com/v1/people/~?format=json
sample response

{
"firstName": "Frodo",
"headline": "Jewelery Repossession in Middle Earth",
"id": "1R2RtA",
"lastName": "Baggins",
"siteStandardProfileRequest": {
"url": "https://www.linkedin.com/profile/view?id=…"
}
}

Due to the unique nature of these two data formats, the field identifiers you will encounter in the output may differ slightly. Make a sample API call using the format you intend your application to work with to ensure you know exactly how to reference the information you seek within the response.

Sending data to the APIs –

Certain API calls (e.g. Share with LinkedIn) require you to send data in a particular format as part of the API call.  By default, all API calls expect input in XML format, however, if it is more convenient for your application to submit data in JSON format, you can inform the APIs that they will be receiving a JSON-formatted payload by including the following two HTTP header values in the call:

• Content-Type: application/json

• x-li-format: json

Every API call requiring data to be sent by POST or PUT has a different data structure than expected in the payload.  Refer to the sample documentation for your specific call to see the exact XML and JSON payload formats to complete your request.

Understanding request throttling –

All LinkedIn API requests are throttled to prevent abuse and ensure stability. The exact number of calls that your application can make per day varies based on the type of request you are making. You will find this information alongside the documentation for each specific API call.

There are three different kinds of throttles in place:

1. Application Throttle — The total number of calls your application can make daily.

2. User Throttle — The number of calls that any unique individual member using your application can make daily.

3. Developer Throttle — The total number of calls that any user identified as a “developer” in the Application’s settings can make in a day.

Please note that for the purposes of request throttling, the API server’s “day” is defined as the 24-hour period beginning at midnight UTC and ending at midnight on the following day.

How to get your LinkedIn API Key

Now that we know the above concepts, the next step is to get your LinkedIn API key. This could help with various plugins that are used on LinkedIn.

For example, if you want advanced analytics, you will need to specify your LinkedIn API key when configuring the CloudApply plugin. Hence, if you don’t already have a LinkedIn API key, you need one to use the Apply Plugin. Create a LinkedIn® API key and remember the one that is generated for you. It will look something like d8amgl12v4ht. Also, if you already have a LinkedIn® API key, you can reuse it.

To retrieve your API Key –

1 Navigate to https://devloper.linkedin.com/.

2 Click Sign In.

3 Log in using your LinkedIn® account credentials.

4 Click OK, I’ll Allow It.

5 From the Support menu, select API Keys.

6 Click Add New Application.

7 On the Add New Application page, complete the required information for each field, noting the following :

• In the Application Name field, enter a name for the application (e.g., Acme Staffing LinkedIn® Integration).

• In the OAuth User Agreement Default Scope field, select the following scope:

r_emailaddress,

r_contactinfo,

r_fullprofile

• In the OAuth 2.0 Redirect URLs field, list the following, separating each by a comma:

http://apply.useast.appfog.ctl.io/api/signin.php,

https://apply.useast.appfog.ctl.io/api/signin.php

• In the JavaScript API Domains field, list the following, separating each by a comma:

http://apply.useast.appfog.ctl.io,

https://apply.useast.appfog.ctl.io,

http://yourdomain.com (change to be the domain of your job pages)

• Click Add Application.

• On the Application Details page, copy the string of letters and numbers under the API Key and Secret Key fields and paste it into the API Key and Secret Key fields on the Configure Widget form back in ApplyMetrics; then complete the rest of the instructions above to finish enabling the integration.

 

How to integrate LinkedIn API

Hence, the final step is to use your perfect LinkedIn API. So, basically follow these simple steps :

Step 1 – Authenticate the user

The bulk of the work required to Sign In with LinkedIn is completed when you authenticate the current user.  If you do not have a previously stored access token for the current user, follow the steps outlined in the Authenticating with OAuth 2.0 Guide to acquire a new access token that can be used in the next step of the Sign-in process.

You can download the official LinkedIn button images in your project from the Image Resources section if required.

See Permissions and Limits to ensure your application requests the correct member permissions for this API call during the OAuth 2.0 authentication process.

Step 2 – Retrieve basic profile data

Once you have obtained a valid access token for the user, you can use the following REST API call to retrieve basic profile data for the user :

GET
https://api.linkedin.com/v1/people/~?format=json
sample api response
{
  "firstName": "Frodo",
  "headline": "2nd Generation Adventurer",
  "id": "1R2RtA",
  "lastName": "Baggins",
  "siteStandardProfileRequest": {
    "url": "https://www.linkedin.com/profile/view?id=…"
  }
}

With this basic profile information in hand, the sign-in process can be considered complete, and it’s time for your application to continue the user experience.

Requesting additional profile fields –

LinkedIn does not return all possible member profile fields by default. There is a limited selection of additional member fields that are also available to you which may be relevant to your application. Refer to the Basic Profile Fields page for a complete list of the basic member profile fields.

The following example demonstrates how to customize your API call to request specific member profile fields that you wish to be returned during the Sign In with LinkedIn workflow :

GET
https://api.linkedin.com/v1/people/~:(id,num-connections,picture-url)?format=json
sample api response
{
  "id": "1R2RtA",
  "numConnections": 42,
  "pictureUrl": "https://media.licdn.com/mpr/mprx/…"
}

Requesting alternate profile languages –

LinkedIn members have the opportunity to provide their profile information in multiple languages. To specify the language you would prefer to have returned, you include an Accept-Language HTTP header with your call. The header’s value should be a comma-separated list of Language Codes, ordered from highest to lowest priority of preference.

Be aware that these are not localized or automatically translated values. The only non-English information available is information manually entered by the member.

sample http header
Accept-Language: es-ES, en-US, it-IT 

The header value is not strictly enforced, so the API will always try to return data whenever possible. If you specify a particular language and the member doesn’t have matching profile data, it will fall back to returning data in the member’s primary language rather than returning nothing at all.

 

Hopefully, this guide will help you with your LinkedIn API.

About Navaneetha

Navaneetha, popularly known as "nav", loves to read, play badminton, play the keyboard and sing but when she's not doing any of those, she loves to write. What started as a high school hobby to write is now her ongoing passion. At AeroLeads, she manages Inbound Marketing and Social Media Marketing.

One Thought on “Complete guide on LinkedIn API 2024 | AeroLeads

  1. Vivek on May 15, 2020 at 7:14 am said:

    very well documented , a very good read.

Leave a Reply

Your email address will not be published. Required fields are marked *

[simple-author-box]

Post Navigation