Some time ago, I wanted to analyze all LinkedIn posts on our company page. The reason was that I wanted to know which organic posts were performing the best. This would give an initial indication of what content would be suitable for ads.
So I took Make, queried the LinkedIn API once, and pulled all the posts. Unfortunately, this wasn’t so trivial, because the LinkedIn API documentation is a disaster.
But don’t worry, I’ve got your back.
Growth Tip 💡
If you want to advertise on LinkedIn, don’t use the typical ads that ask to buy or download.
Think of ads on LinkedIn as a way to target your content and send it to your users‘ feed. Therefore, your ads should also provide value.
In the first step, it doesn’t matter if someone clicks or not. The goal is to increase brand awareness and provide value to your customers so that you stay in their minds.
So take your best and most valuable organic posts from your LinkedIn page and promote them with some budget.
Preparatory steps before calling the API
LinkedIn does not make the API request easy for us. The use must also be approved first.
To do this, we open: https://developer.linkedin.com
There we will find the „My Apps“ tab in the upper right corner.
After clicking on it and logging in, we land on an overview where we can create our own LinkedIn app. This is necessary for LinkedIn to give us access to its own API.
With a click on „Create App“ we can create our app.
On the following page, we fill in all the required fields.
Next, LinkedIn asks us what „product“ we want. This ultimately determines which features of the API we can use.
LinkedIn distinguishes between three „products“ here:
- Share on LinkedIn: Provides the ability to share content via the API
- Sign In with LinkedIn: Offers the possibility to log in via the API.
- Marketing Developer Platform: Offers among other things the possibility to get statistics and KPIs
In our case, the product of interest is „Makreting Developer Platform“.
When we click on „Request access“, a pop-up window opens, informing us that we need to fill in an additional form with further details in order to get access.
We agree to the terms and click „Request Access“ again.
Now it takes a few minutes for the form to become available.
When it is ready, we click on „Request Access Form“ in the product overview.
Now a form opens, which we fill in.
LinkedIn wants a description here about what you plan to do with the API, what your company does, etc.
When we submit the form, it says „Review in progress“ next to the product.
Now it takes about 1-3 business days for LinkedIn to review the request and for us to start working with the API.
Setting up the Make module for the LinkedIn API call
To make a LinkedIn API call using Make (Integromat), we set up a new scenario.
Make gives us a LinkedIn module that provides some good functionality, but the LinkedIn „Make an API Call“ module often didn’t work for me.
So in this case, we use the HTTP module to make an OAuth 2.0 request.
OAuth is an authorization protocol that includes a security layer to avoid unprotected API requests.
We set up the http module as follows:
First, we click „Add“ at the top to create the connection.
Now a window opens that wants certain things from us.
We fill in these fields as follows:
- Connection name: Here we can give our connection a name.
- Flow type: By default, we leave this set to Authorization Code.
- Authorize URI: This is the URL that LinkedIn will use for authorization. It can also be found in the API documentation and is as follows: https://www.linkedin.com/oauth/v2/authorization
- Token URI: This is the URL for requesting the security token, which can also be found in the API documentation: https://www.linkedin.com/oauth/v2/accessToken
- Scope: These define what your application can do on behalf of a user. You can find the scopes in the Auth overview of our product in the LinkedIn app.
In our case, we need the following scope here: r_organization_social.
- Client ID & Client Secret: This is to ensure that we are requesting the correct API/app and are authorized to do so. We can also find this in the „Auth Overview“ of our LinkedIn app.
Ultimately, the Make module should look like this:
With one click on the save button, the LinkedIn login screen opens and we need to sign in here and agree that Make can use our required data.
Make a LinkedIn API call
Now we are almost done.
To complete the API call, we need to request the correct API URL.
We add it under the URL field.
In my case, the URL is here:
The URL looks like the following, where „company URN“ and „count“ need to be customized:
To request company pages, you need your own company URN.
It looks typically like the following:
The number at the end of the URN is your company page ID on LinkedIn.
You can find it in the URL when you click your LinkedIn page in administration mode.
This would result in the following URN for my page:
But since this is still not enough, it only works if it is also encrypted.
So we open e.g. https://meyerweb.com/eric/tools/dencoder/
Add our URN and click on Encode.
The result is the following:
We now add this to our API URL.
At the end of the URL, we change „count=X“ to the number of posts we want the API to display.
In my case I want the API to display the last 10 posts:
Now we add the link in our module setup and it looks like this:
To finish setting up the module, we leave the method set to „GET“.
We add the following value to the header:
This way we make sure that the correct version of the API is requested.
Last but not least, we set the radio button at „Parse response“ to „Yes“. This ensures that our data is displayed correctly.
That’s it. Now we can start our API request.
The last thing missing is the redirect URL. API requests need this to redirect you after login.
Since we are making the API request through Make (Integromat), we need a special URL here so LinkedIn knows it is Make. Otherwise, the request will not work.
This URL in this case is:
We store this in the app overview under the Auth tab.
Now we can start our API request and retrieve posts from our company page.
How to work with the data?
To use the data from the API, we set up another Make module.
In this case, the module is the „Get the Statistics of Shares“ module.
With this, we are able to get the statistics from the posts. So we can see likes, impressions and overall engagement.
We set up the module and connect our account. Then we add the ID of the particular post that comes from the API request into the corresponding field of the module.
Sometimes you need to distinguish between „Share URN 1“ and „UGC Posts“. Because some post types have a different ID category. If you need help here – drop me a message on Twitter.
Now we can add a module of our database or project management tool (Airtable etc.) and let the data be imported there.
After we run the scenario, we get all the data we need to create an overview of our LinkedIn post KPIs.