Partager via


Celebration API

Warning

Deprecation Notice
The Marketing Version 202310 (Marketing October 2023) and earlier versions (excluding 202306 and 202307) have been sunset. Additionally, the unversioned APIs will 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.

The LinkedIn Celebration post API helps you fetch celebration content type post.

Note

Currently, Celebration post cannot be created through external apis and instead, it will throw 400. Only fetching celebration post is allowed.

Permissions

Permission Description
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
  • r_member_social (Restricted) Retrieve posts, comments, and likes on behalf of an authenticated member. This is a private permission.

    See Organization Access Control for more information on company page roles.

    Prerequisites

    Please check the Posts API for more information.

    Schema

    Celebration

    Field Format Description Required
    recipients array of Urn Recipient(s) of the celebration. Only certain celebration types can have recipients create-only optional
    taggedEntities array of Urn Tagged entity(s) of the celebration. Only certain celebration types can have taggedEntities. create-only optional
    type
  • CELEBRATE_WELCOME - Welcome a new member to the team
  • CELEBRATE_ANNIVERSARY - Celebrate a job anniversary
  • CELEBRATE_AWARD - Celebrate an award or honor
  • CELEBRATE_EVENT-Celebrate a team event, such as an offsite or dinner
  • CELEBRATE_GRADUATION - Celebrate a graduation
  • CELEBRATE_JOB_CHANGE - Celebrate a job change
  • CELEBRATE_KUDOS - Celebrate appreciation by giving kudos
  • CELEBRATE_LAUNCH - Celebrate a product or project launch
  • CELEBRATE_CAREER_BREAK - Celebrate a career break
  • CELEBRATE_CERTIFICATE - Celebrate a certificate
  • CELEBRATE_EDUCATION - Celebrate an education
  • CELEBRATE_MILESTONE - Celebrate a milestone or achievement
  • Type of celebration created. required
    text string in little format any associated strings on Celebration content (eg. mentions/tags on celebration objects itself) optional
    media Urn (either urn:li:image or urn:li:celebrationTemplate). urn:li:image means that users provided their own image. urn:li:celebrationTemplate means that users used LI provided celebration template image The urn of the template or user-provided image this Celebration was created with. User needs to specify either user-provided image (image) or LinkedIn provided celebration templates. Only certain templates are available for each celebrationType. required

    Get Celebration Content

    Sample Request

    GET https://api.linkedin.com/rest/posts
    

    A successful response returns a 200 HTTP status code and payload.

    Sample Response

    {
        "lifecycleState": "PUBLISHED",
        "lastModifiedAt": 1696966499120,
        "visibility": "PUBLIC",
        "publishedAt": 1696966072646,
        "author": "urn:li:organization:2414183",
        "distribution": {
            "feedDistribution": "MAIN_FEED",
            "thirdPartyDistributionChannels": []
        },
        "content": {
            "celebration": {
                "media": "urn:li:celebrationTemplate:PLANES",
                "type": "CELEBRATE_CERTIFICATE"
            }
        },
        "lifecycleStateInfo": {
            "isEditedByAuthor": false
        },
        "isReshareDisabledByAuthor": false,
        "createdAt": 1696966072646,
        "id": "urn:li:ugcPost:7117591584669327360",
        "commentary": "Celebrating my new certification!"
    }
    

    Batch Get Celebration Content

    Sample Request

    You can also fetch multiple posts with different types of content by providing multiple post IDs. The example response shows a Batch Get response for two posts, one with Celebration content and the other with Carousel content.

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

    Sample Response

    {
       "results": {
           "urn:li:ugcPost:7117591584669327360": {
                "lifecycleState": "PUBLISHED",
                "lastModifiedAt": 1696966499120,
                "visibility": "PUBLIC",
                "publishedAt": 1696966072646,
                "author": "urn:li:organization:2414183",
                "distribution": {
                    "feedDistribution": "MAIN_FEED",
                    "thirdPartyDistributionChannels": []
                },
                "content": {
                    "celebration": {
                        "media": "urn:li:celebrationTemplate:PLANES",
                        "type": "CELEBRATE_CERTIFICATE"
                    }
                },
                "lifecycleStateInfo": {
                    "isEditedByAuthor": false
                },
                "isReshareDisabledByAuthor": false,
                "createdAt": 1696966072646,
                "id": "urn:li:ugcPost:7117591584669327360",
                "commentary": "Celebrating my new certification!"
            },
           "urn:li:ugcPost:6914373086788128769": {
               "lifecycleState": "PUBLISHED",
               "lastModifiedAt": 1648516563685,
               "visibility": "PUBLIC",
               "publishedAt": 1648515006906,
               "author": "urn:li:organization:2414183",
               "distribution": {
                   "feedDistribution": "NONE",
                   "thirdPartyDistributionChannels": []
               },
               "content": {
                   "carousel": {
                       "cards": [
                           {
                               "landingPage": "http://www.linkedin.com/",
                               "media": {
                                   "title": "first card",
                                   "taggedEntities": [],
                                   "id": "urn:li:image:C4E22AQGX_uq7mQBfAA"
                               }
                           },
                           {
                               "landingPage": "http://www.linkedin.com/",
                               "media": {
                                   "title": "second card",
                                   "taggedEntities": [],
                                   "id": "urn:li:image:C4E22AQGX_uq7mQBfAA"
                               }
                           }
                       ]
                   }
               },
               "lifecycleStateInfo": {
                   "isEditedByAuthor": false
               },
               "contentLandingPage": "http://www.linkedin.com/contentLandingPage",
               "isReshareDisabledByAuthor": false,
               "createdAt": 1648515006906,
               "id": "urn:li:ugcPost:6914373086788128769",
               "commentary": "test strings",
               "adContext": {
                   "dscStatus": "ACTIVE",
                   "dscAdType": "CAROUSEL",
                   "isDsc": true,
                   "dscAdAccount": "urn:li:sponsoredAccount:508915158"
               }
           }
       },
       "statuses": {
           "urn:li:ugcPost:7117591584669327360": 200,
           "urn:li:ugcPost:6914373086788128769": 200
       },
       "errors": {}
    }
    

    API Error Details

    HTTP Status Code Error Message Description Error Resolution
    401 EMPTY_ACCESS_TOKEN Empty or expired OAuth2 access token Make sure you provide valid OAuth2 access token
    403 ACCESS_DENIED Not enough permissions to access this endpoint Make sure your developer application is provisioned with this endpoint
    404 NOT_FOUND Content not found Verify the provided id is correct
    500 INTERNAL_SERVER_ERROR Internal server side error N/A

    References