Back

LinkedIn Ads API Essential Guide

Aug 1, 20246 minute read

What type of API does LinkedIn Ads provide?

LinkedIn Ads uses a REST API.

API Type

LinkedIn Ads utilizes a REST API for programmatic access to advertising functionality.

Key Characteristics of REST APIs

  • REST APIs are resource-based, with each resource identified by a unique URI.
  • They use standard HTTP methods like GET, POST, PUT, DELETE.
  • REST APIs have a uniform interface that allows clients to interact with resources using standardized methods and response formats.
  • They are stateless, meaning each request contains all necessary information to process it.
  • REST APIs are cacheable, which can improve performance.

Consuming the LinkedIn Ads REST API

To use the LinkedIn Ads API, developers would typically:

  1. Authenticate using OAuth 2.0
  2. Make HTTP requests to specific endpoints
  3. Send data in the request body for POST/PUT requests
  4. Parse the JSON responses to extract advertising data

For example, a basic GET request might look like:

fetch('https://api.linkedin.com/v2/adAccounts', { headers: { 'Authorization': 'Bearer YOUR_ACCESS_TOKEN', 'Content-Type': 'application/json' } }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error('Error:', error));

Does the LinkedIn Ads API have webhooks?

Yes, the LinkedIn Ads API has webhooks. LinkedIn calls these "push events" or "notifications" that can be sent to registered webhook endpoints.

Types of events include:

  1. Organization Social Action Notifications
  2. Lead Gen Form Responses
  3. Event Registration Form Responses

Key points about LinkedIn Ads API webhooks:

  1. Webhooks must be registered and validated before receiving notifications.
  2. LinkedIn uses a challenge-response mechanism for validation.
  3. Webhook endpoints are re-validated every 2 hours.
  4. Endpoints are blocked after 3 consecutive failed validations.
  5. Webhooks must respond with a 2xx HTTP status code for successful delivery.
  6. Notifications should be deduplicated using the Notification ID.
  7. Integrity of push events must be verified using the X-LI-Signature header.
  8. Webhooks can be registered in the "Webhooks" tab of the application in the developer portal.
  9. The DeveloperWebhooks API allows partners to verify and resolve webhook URL issues.

Best practices:

  1. Use lambda/serverless functions for testing webhook processing.
  2. Implement security measures, including X-LI-Signature header verification.
  3. Handle potential duplicate notifications.
  4. Monitor webhook endpoints and resolve issues promptly.
  5. Use the DeveloperWebhooks API to manage and revalidate blocked webhook URLs.

For the most up-to-date and complete information on available event types, consult the official LinkedIn Ads API documentation.

Rate Limits and other limitations

Here are the key points about the API rate limits for the LinkedIn Ads API:

General Rate Limiting Approach

  • All API requests are rate limited to prevent abuse and ensure service stability.

  • Rate limits specify the maximum number of API calls that can be made in a 24 hour period.

  • Limits reset at midnight UTC every day.

Types of Rate Limits

There are two main types of rate limits:

  1. Application limit - The total number of calls that your application can make in a day.

  2. Member limit - The total number of calls that a single member per application can make in a day.

Checking Your Specific Limits

  • Standard rate limits are not published in documentation.

  • You can look up the rate limit for any endpoint your app has access to through the Developer Portal:

    • Select your app and navigate to its Analytics tab
    • This will show usage and rate limits for endpoints you've made at least 1 request to that day (UTC)

Handling Rate Limiting

  • Rate limited requests will receive a 429 response.

  • In rare cases, LinkedIn may also return a 429 response as part of infrastructure protection.

  • API service will return to normal automatically after being rate limited.

Best Practices

  • Space out API requests evenly throughout each hour to avoid being rate limited.

  • Avoid API call patterns with high queries per second (QPS) bursts.

  • For compliance APIs, follow the recommended request patterns and limits based on number of unique members.

The specific rate limits can vary by endpoint and application, so it's best to check the Developer Portal for your exact limits. The general approach is to have both application-wide and per-member limits that reset daily.

Latest API Version

Based on the search results provided, here is the answer to your question about the most recent version of the LinkedIn Ads API:

The most recent version of the LinkedIn Ads API is 202407 (July 2024).

Key points to consider:

  1. LinkedIn now supports API versioning for all LinkedIn Marketing APIs, including the Ads API.

  2. New versions are released monthly, with each version supported for a full year.

  3. To call a specific API version, you need to include a request header with the key "LinkedIn-Version" and set the value to the version you're referencing using the YYYYMM format.

  4. The versioned APIs use a new base path: https://api.linkedin.com/rest/

  5. Legacy (unversioned) Marketing APIs using the base path https://api.linkedin.com/v2/ were available until June 30, 2023, when they were sunset.

Best practices:

  1. Stay updated with the latest API versions by regularly checking the Recent Changes page.

  2. Migrate to the versioned APIs as soon as possible to avoid disruptions in your integrations.

  3. Use the comprehensive documentation provided for each API version, which includes changelogs indicating updates and additions.

  4. Be prepared to update your integrations at least annually, as LinkedIn may sunset API versions as early as one year after release.

  5. If you haven't migrated yet and have questions, submit a request on the LinkedIn Developer Support Portal.

By staying current with the latest API version, you can ensure that your integrations continue to work smoothly and take advantage of the newest features and improvements in the LinkedIn Ads API.

How to get a LinkedIn Ads developer account and API Keys?

Here are the key steps to get a developer account for LinkedIn Ads to create an API integration:

  1. Create a LinkedIn Developer account:

    • Go to the LinkedIn Developer Portal [https://developer.linkedin.com/]
    • Sign in with your LinkedIn account or create one if you don't have it
  2. Create an app:

    • Click on "My Apps" and select "Create App"
    • Fill in the app details and add your company page
    • Check the box for "Marketing Developer Platform" under Products
  3. Apply for Advertising API access:

    • In your app, go to the "Products" tab
    • Find "Advertising API" and click "Request Access"
    • Agree to the terms and conditions
    • Fill out the access request form that appears
  4. Wait for approval:

    • LinkedIn will review your application (usually takes around 1 day)
    • Check the Developer Portal for the status of your application
  5. If approved:

    • You'll receive an email with details on how to get started
    • You can then enable the Advertising API for your app
  6. Set up authentication:

    • Get your Client ID and Client Secret from the "Auth" tab
    • Set up OAuth 2.0 for authentication

What can you do with the LinkedIn Ads API?

I apologize, but there is no markdown text or content provided in your message. You mentioned "The content is here:" but there is nothing after that. Without the actual content to work with, I cannot perform the requested modifications. If you'd like me to help with formatting markdown text, please provide the text you want me to work on, and I'll be happy to assist you.