Article Post API

Warning

Deprecation Notice
The Marketing version 202209 (Marketing September 2022) and below has been sunset and the unversioned APIs are going to be sunset soon. We recommend that you migrate to the versioned APIs as well as migrate to the new Content and Community Management APIs to avoid disruptions. See the Migration page for more details. If you haven’t yet migrated and have questions, submit a request on the LinkedIn Developer Support Portal.

Linkedin is introducing its next generation of APIs to create and manage Article organic (non-sponsored) posts and Article Ads. These APIs allow advertisers to create ads with content ingested from the web, including web pages, images, videos, and other formats, also known as articles. It also allows API partners to create non-sponsored article posts.

Article Post API does not support url scraping for article post creation as it introduces level of unpredictability in how a post is going to look when API partners create it. Instead, API partners need to set article fields such as thumbnail, title and description within the post when creating an article post.

Permissions

Permission Description
w_organization_social Post, comment and like posts on behalf of an organization. Restricted to organizations in which the authenticated member has one of the following company page roles:
  • ADMINISTRATOR
  • DIRECT_SPONSORED_CONTENT_POSTER
  • CONTENT_ADMIN
  • r_organization_social Retrieve organizations' posts, comments, and likes. Restricted to organizations in which the authenticated member has one of the following company page roles:
  • ADMINISTRATOR
  • DIRECT_SPONSORED_CONTENT_POSTER
  • CONTENT_ADMIN
  • w_member_social Post, comment and like posts on behalf of an authenticated member.
    r_member_social (Restricted) Retrieve posts, comments, and likes on behalf of an authenticated member. This is a restricted permission.

    See Account Access Controls for more information on company page roles.

    Prerequisites

    Any assets (e.g. images) must be uploaded via Images API.

    Workflow

    1. Upload Article image assets via Images API

      Note

      This step only applies for optional thumbnail content

    2. Create Article content
    3. Get Article content
    4. Batch Get Article content

    Schema

    Field Type Details/Notes/Values Required
    description string Custom or saved description of the article. If empty, there is none. The length must be less than 4086 characters. optional
    source URL A URL of the article. Typically the URL that was ingested to maintain URL parameters. Please note that this field maps to "Destination URL" field in Campaign Manager UI. required
    thumbnail ImageUrn Custom or saved thumbnail for the article. If empty, there is none. To retrieve the download URL, an additional request must be made to the Images API using this URN. optional
    thumbnailAltText string Alt text for the custom thumbnail. If empty, there is none. The length must be less than 4086 characters. optional
    title string Custom or saved title of the article. The length must be less than 400 characters. required

    Managing Article Content

    Create Article Content

    Note that to include a thumbnail, the image must be fetched and uploaded if it is to be included. See Workflow for more details.

    POST https://api.linkedin.com/rest/posts
    
    {
     "author": "urn:li:organization:5515715",
     "commentary": "test strings",
     "visibility": "PUBLIC",
     "distribution": {
       "feedDistribution": "MAIN_FEED",
       "targetEntities": [],
       "thirdPartyDistributionChannels": []
     },
     "content": {
         "article": {
             "source": "https://lnkd.in/eabXpqi",
             "thumbnail": "urn:li:image:C49klciosC89",
             "title": "prod test title two",
             "description": "test description"
         }
     },
     "lifecycleState": "PUBLISHED",
     "isReshareDisabledByAuthor": false
    }
    

    A successful response returns a 201 Created HTTP status code and the ID in the x-linkedin-id response header.

    Get Article Content

    You can retrieve Article content associated with a Post by performing a GET operation. The operation must be performed to the Posts API on a post that was created with Article content. Example post ID: urn:li:share:6894794184403075072

    Note

    To retrieve the download URL for a thumbnail, an additional request must be made to the Images API which returns the highest resolution version of the thumbnail.

    GET https://api.linkedin.com/rest/posts/{postId}
    

    Sample Response

    {
        "isReshareDisabledByAuthor": false,
        "createdAt": 1643847032795,
        "lifecycleState": "PUBLISHED",
        "lastModifiedAt": 1643847032891,
        "visibility": "PUBLIC",
        "publishedAt": 1643847032795,
        "author": "urn:li:organization:5515715",
        "id": "urn:li:share:6894794184403075072",
        "distribution": {
            "feedDistribution": "MAIN_FEED",
            "thirdPartyDistributionChannels": []
        },
        "content": {
            "article": {
                "title": "test title_2",
                "source": "https://lnkd.in/eabXpqi"
            }
        },
        "commentary": "Test String",
        "lifecycleStateInfo": {
            "isEditedByAuthor": false
        }
    }
    

    Batch Get Article Content

    You can fetch multiple posts with different types of content by providing multiple post IDs.

    POST https://api.linkedin.com/rest/posts?ids={encoded postId}&ids={encoded postId}
    

    Sample Response

    {
       "results": {
           "urn:li:share:6927417443392843776": {
               "isReshareDisabledByAuthor": false,
               "createdAt": 1651625023833,
               "lifecycleState": "PUBLISHED",
               "lastModifiedAt": 1651625023833,
               "visibility": "PUBLIC",
               "publishedAt": 1651625023833,
               "author": "urn:li:organization:5515715",
               "id": "urn:li:share:6927417443392843776",
               "distribution": {
                   "feedDistribution": "MAIN_FEED",
                   "thirdPartyDistributionChannels": []
               },
               "content": {
                   "article": {
                       "title": "prod test title one",
                       "description": "test description",
                       "source": "https://lnkd.in/eabXpqi"
                   }
               },
               "commentary": "test strings2",
               "lifecycleStateInfo": {
                   "isEditedByAuthor": false
               }
           },
           "urn:li:share:6927417320021585920": {
               "isReshareDisabledByAuthor": false,
               "createdAt": 1651624994433,
               "lifecycleState": "PUBLISHED",
               "lastModifiedAt": 1651624994433,
               "visibility": "PUBLIC",
               "publishedAt": 1651624994433,
               "author": "urn:li:organization:5515715",
               "id": "urn:li:share:6927417320021585920",
               "distribution": {
                   "feedDistribution": "MAIN_FEED",
                   "thirdPartyDistributionChannels": []
               },
               "content": {
                   "article": {
                       "title": "prod test title two",
                       "description": "test description",
                       "source": "https://lnkd.in/eabXpqi"
                   }
               },
               "commentary": "test strings1",
               "lifecycleStateInfo": {
                   "isEditedByAuthor": false
               }
           }
       },
       "statuses": {
           "urn:li:share:6927417443392843776": 200,
           "urn:li:share:6927417320021585920": 200
       },
       "errors": {}
    }
    

    Inline Create Article creative

    This is for creating sponsored article creative only. If you only want to create organic (non-sponsored) article posts, please skip this section.

    POST https://api.linkedin.com/rest/creatives?action=createInline
    
    {
        "creative": {
            "inlineContent": {
                "post": {
                    "adContext": {
                      "dscAdAccount": "urn:li:sponsoredAccount:520866471",
                      "dscStatus": "ACTIVE"
                    },
                    "author": "urn:li:organization:5515715",
                    "commentary": "This is an ad.",
                    "visibility": "PUBLIC",
                    "lifecycleState": "PUBLISHED",
                    "isReshareDisabledByAuthor": true,
                    "content": {
                        "article": {"source": "http://www.ddrfreak.com", "title": "test title"}
                    },
                    "contentLandingPage": "http://www.ddrfreak.com/contentLandingPage"
                  }
            },
            "campaign": "urn:li:sponsoredCampaign:360035215",
            "intendedStatus": "ACTIVE"
        }
    }
    

    A successful response returns a 201 Created HTTP status code and the ID in the x-linkedin-idresponse header. For example, urn:li:sponsoredCreative:121609175

    References