LinkedIn API Configuration Made Easy: Developer Account and OAuth Setup
Hi Everyone, hope you are keeping well. Thank you so much for stopping by. Welcome to my LinkedIn API (Advertising API) Setup Guide, where you’ll embark on a seamless journey towards harnessing the power of LinkedIn Advertising API. We’ll guide you through the process of setting up a LinkedIn developer account, creating an application within it, enabling the LinkedIn Advertising API, and taking your first steps in making LinkedIn API calls using Python. The goal is to simplify the LinkedIn API configuration process, making it accessible and manageable for developers of all levels.
Let’s dive in.

What is the LinkedIn API?
The LinkedIn Marketing API is used to programmatically query data, create and manage ads, create and manage campaigns, get account-related data, and perform a wide variety of other tasks. This guide helps you complete all the steps needed to use LinkedIn Marketing API successfully.
The LinkedIn API is the REST API and is the heart of all programmatic interactions with LinkedIn. LinkedIn API enables you to bring the power of the world’s largest professional network to your apps. By using the LinkedIn API (also known as LinkedIn Marketing API) you can use several LinkedIn services. Most importantly you can extract your campaign performance data using this API.
Table of Contents:
- Create an App on LinkedIn Developer
- Enabling Advertising API
- Get Access Token
- Making the First API call
Quick Access:
1. First create an app in the LinkedIn Developer Portal
Go to the LinkedIn Developer Portal. You might need to log in using your LinkedIn account credentials. Once you are logged in you should see the below screenshot as your screen.

To create a new App, fill up the details in the above form and click on the “Create App” button. Now you should see your app created, in my case, I see the screenshot below.

The last step is verifying the company account. To create an app you need to give a LinkedIn company page link or name. Now you need to verify it. Click on the “Verify” button. You should see a pop-up titled “Verify Company”, look for the button “Generate URL” and click on it.


If you are the admin of the LinkedIn Company Page or have admin access to the LinkedIn Company Page. Copy this verifying link and open it in the new tab and click on “verify”. In case you are not the admin of the page then send this link to the admin of the page and ask them to verify it.
Finally come back to the “Verify Company” pop-up and click on the “I’m done” button. Ideally, you should be on the LinkedIn developers portal. Select the app you just created.
2. Enabling Advertising API permissions
To be able to generate access tokens and extract data from LinkedIn campaign managers using the LinkedIn API developer APP you will need to have access to Advertising API permission.
A. Getting Advertising API Permission for the LinkedIn API App
So far if you have followed the above step you should be on a screen that should like the below screenshot.

Click on the “Products” tab. Look for the “Advertising API” product and click on the “Request Access” button.

A pop-up to get your consent on LinkedIn Product Terms and Conditions will show. Read the terms agree to those terms and click on the “Request Access” button.
Now you should see an option to “access request form”. Check out the screenshot below. A link to the access request form will show up there in a few minutes. To complete your Advertising API application, fill out the form.

Note: After submitting the form wait for some time (i.e. around 1 day).
B. Add ads account to Advertising API(Optional)
In the app go to the “product” tab and click on the “View Ad Accounts” option in the card/container titled Advertising API.


Then click on “Add Ad Account” enter the ad account number and click on the “Save Ad Account” button.

Note: You will get an Account ID in Linkedin Campaign Manager. Just below the account name, you will see an account ID, or in the URL you will see the account ID.
If you’re looking to maximize the potential of LinkedIn API integration, I’m here to help. Whether you have questions, need guidance, or automated token generation solutions, or require tailored consulting services, don’t hesitate to reach out. Let’s discuss how I can assist you in achieving your goals in just no time. Connect with me through the provided Contact Form, and let’s start a conversation about your unique requirements.
3. Generating Access Token with Postman
Step1:
Go to the LinkedIn Developer Portal, select your app, navigate to the “Auth” section, and allocate your “Client ID” and “Client Secret”.
HeadsUp: we will be using this Client ID and Client Secret in other places too.

Step2:
From the same “Auth” tab, scroll to the bottom. Under “OAuth 2.0 Settings”, add the Postman callback URL https://www.getpostman.com/oauth2/callback.
Step3:
Open a new tab in Postman and navigate to “Authorization”.
Step 4:
Change the “TYPE” to “Oauth 2.0”.
Step 5:
Click “Get New Access Token”.
Step 6:
Fill out the form in the pop-up window with the following values and click “Request Token”.
- Grant Type = Authorization Code
- Callback URL = https://www.getpostman.com/oauth2/callback
- Auth URL = https://www.linkedin.com/oauth/v2/authorization
- Access Token URL = https://www.linkedin.com/oauth/v2/accessToken
- Client ID = {Copy this from the “Auth” tab in the developer portal}
- Client Secret = {Copy this from the “Auth” tab in the developer portal}
- Scope = contacts,r_organization_social,w_organization_social,rw_organization_admin,rw_ads,r_ads_reporting,r_liteprofile or contacts or r_ads,rw_ads,r_ads_reporting,r_basicprofile,rw_organization_admin
- Client Authentication = Send client credentials in body
- State = any unique string eg: 12abc34.
Postman will take you to the LinkedIn authorization page. You may be prompted to log in to LinkedIn before getting to the below screen. Click “Allow” to authorize the request.
After that, Postman will then display your access token and refresh_token.
If you were able to pass all the hurdles till now, Congratulations!..
If not, don’t worry, take a break and try again. I’m confident you will crack it.
4. Test the Access Token (i.e making the first API call)
Store the credentials (Access Token, Refresh Token, Expiry Time, etc) in JSON format by creating a separate JSON file. This will help you manage your LinkedIn credential easily and keep it more secure.
{ "linkedin_cred": { "access_token":"Replace it with LinkedIn access_token", "client_id":"Replace it with client id", "Client_secret":"Replace it with client secret", "Account_id":"Replace it with LinkedIn ads account id", "expires_in":"Replace it with access_token expiry", "refresh_token":"Replace it with refresh_token", "refresh_expire":"Replace it with refresh_token expiry" } }
Understand the below code and create a test code. I named the Python code file below -> “access_token_check”.
#!/usr/bin/python3 import requests import json #reading client_id json file cred_file = "./linkedin_cred.json" cred = open(cred_file, 'r') ln_cred= json.load(cred) access_token = ln_cred["linkedin_cred"]["access_token"] url = "https://api.linkedin.com/v2/me" headers = {"Authorization": "Bearer "+access_token} #make the http call r = requests.get(url = url, headers = headers) if r.status_code != 200: print("something went wrong :",r) else: response_dict = json.loads(r.text) print("Account Description :\n",response_dict)
By running the above file with (python3 ./access token check.py). You should see your LinkedIn profile data printed in the console.
If you see the above output that means the access_token you generated through the above process is working and you are good to go with your advanced application using LinkedIn API.
Congratulation! you have successfully set up LinkedIn API. Now, here’s my guide to help you develop complete Python code for extracting campaign data using LinkedIn API with full code structuring. End-To-End LinkedIn Campaign Data Extraction Programmatic Solution.
Hope I was able to solve the problem. If you like this article and think it was easy to understand do share it with your friends and connection. Thank you! See you soon.
Checkout out my other API Integration and Coding Solution Guide
For any suggestions or doubts ~ Get In Touch