LinkedIn Use Cases > Posts API

The Posts API facilities the creation and retrieval of organic and sponsored posts.

Documentation

📖
Documentation
https://learn.microsoft.com/en-us/linkedin/marketing/
📖
GettingStarted
https://learn.microsoft.com/en-us/linkedin/marketing/getting-started
📖
Documentation
https://learn.microsoft.com/en-us/linkedin/learning/
📖
GettingStarted
https://learn.microsoft.com/en-us/linkedin/learning/getting-started
📖
Documentation
https://learn.microsoft.com/en-us/linkedin/learning/getting-started/terminology
📖
Documentation
https://learn.microsoft.com/en-us/linkedin/learning/integrations/xapi
📖
APIReference
https://learn.microsoft.com/en-us/linkedin/learning/reporting/reporting-docs/reporting-api
📖
Documentation
https://learn.microsoft.com/en-us/linkedin/talent/
📖
GettingStarted
https://learn.microsoft.com/en-us/linkedin/talent/getting-started
📖
Documentation
https://learn.microsoft.com/en-us/linkedin/talent/versioning
📖
Documentation
https://learn.microsoft.com/en-us/linkedin/compliance/
📖
GettingStarted
https://learn.microsoft.com/en-us/linkedin/compliance/getting-started
📖
Documentation
https://learn.microsoft.com/en-us/linkedin/compliance/compliance-api/overview
📖
Documentation
https://learn.microsoft.com/en-us/linkedin/sales/
📖
APIReference
https://learn.microsoft.com/en-us/linkedin/sales/display-services/
📖
APIReference
https://learn.microsoft.com/en-us/linkedin/sales/analytics-services/
📖
APIReference
https://learn.microsoft.com/en-us/linkedin/sales/sync-services/
📖
Documentation
https://learn.microsoft.com/en-us/linkedin/dma/
📖
Documentation
https://learn.microsoft.com/en-us/linkedin/dma/member-data-portability/
📖
Documentation
https://learn.microsoft.com/en-us/linkedin/dma/pages-data-portability-overview
📖
Documentation
https://learn.microsoft.com/en-us/linkedin/dma/transparency/advertiser-transparency

Specifications

Other Resources

OpenAPI Specification

linkedin-use-cases-posts-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: LinkedIn Compliance Events Access Control Use Cases > Posts API
  description: LinkedIn provides Compliance API Guides for monitoring, archiving, and management of communications for enterprises in regulated industries. The Compliance Events API allows applications to archive all LinkedIn activities from the past 30 days of a regulated, authenticated member.
  version: 1.0.0
  contact:
    name: LinkedIn API Support
    url: https://docs.microsoft.com/en-us/linkedin/compliance/
servers:
- url: https://api.linkedin.com
  description: LinkedIn Production API Server
security:
- OAuth2Auth:
  - r_compliance
tags:
- name: Use Cases > Posts
  description: The Posts API facilities the creation and retrieval of organic and sponsored posts.
paths:
  /posts/{encoded ugcPostUrn|shareUrn}:
    get:
      tags:
      - Use Cases > Posts
      summary: LinkedIn Get Posts by URN
      description: Creating posts with image requires uploading an image asset to obtain a Image URN (urn:li:image:{id}) for creating the post. See the [Images API](https://docs.microsoft.com/en-us/linkedin/marketing/integrations/community-management/shares/images-api?view=li-lms-2022-08) for instructions on how to do this.
      parameters:
      - name: LinkedIn-Version
        in: header
        schema:
          type: string
        example: '{{insert_version}}'
      - name: X-Restli-Protocol-Version
        in: header
        schema:
          type: string
        example: 2.0.0
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      operationId: getGetPostsByUrn
      x-microcks-operation:
        dispatcher: FALLBACK
        dispatcherRules: '{}'
        delay: 0
    delete:
      tags:
      - Use Cases > Posts
      summary: LinkedIn Delete a Post
      description: 'Post deletions are idempotent. Deletion requests for a previously deleted UGC Post will return a `204` code - No Content.


        ####'
      parameters:
      - name: LinkedIn-Version
        in: header
        schema:
          type: string
        example: '{{insert_version}}'
      - name: X-Restli-Protocol-Version
        in: header
        schema:
          type: string
        example: 2.0.0
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      operationId: deleteDeleteAPost
      x-microcks-operation:
        dispatcher: FALLBACK
        dispatcherRules: '{}'
        delay: 0
  /posts/{shared ID}/{ugcPosts ID}:
    post:
      tags:
      - Use Cases > Posts
      summary: LinkedIn Update a Post
      description: 'The following `posts` field are available to update. Refer to [Schema](https://docs.microsoft.com/en-us/linkedin/marketing/integrations/community-management/shares/posts-api?view=li-lms-2022-08&tabs=http#post-schema) for complete field details.


        | Field | Description |

        | --- | --- |

        | commentary | String |

        | contentCallToActionLabel | contentCallToActionLabel text |

        | contentLandingPage | URL of the landing page |

        | reshareContext |  |

        | lifecycleState |  |

        | adContext | \*   dscName: Update the name of the sponsored content<br>\*   dscStatus: Update the status of the sponsored content |'
      requestBody:
        content:
          '*/*':
            schema:
              $ref: '#/components/schemas/UpdateAPostRequest'
      parameters:
      - name: X-Restli-Protocol-Version
        in: header
        schema:
          type: string
        example: 2.0.0
      - name: LinkedIn-Version
        in: header
        schema:
          type: string
        example: '{{insert_version}}'
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      operationId: postUpdateAPost
      x-microcks-operation:
        dispatcher: FALLBACK
        dispatcherRules: '{}'
        delay: 0
components:
  schemas:
    UpdateAPostRequest:
      type: string
      example: '"{\n  \"patch\": {\n    \"$set\": {\n      \"commentary\": \"Update to the post\",\n      \"contentCallToActionLabel\": \"LEARN_MORE\"\n    }\n  }\n}\n"'
  securitySchemes:
    OAuth2Auth:
      type: oauth2
      flows:
        authorizationCode:
          authorizationUrl: https://www.linkedin.com/oauth/v2/authorization
          tokenUrl: https://www.linkedin.com/oauth/v2/accessToken
          scopes:
            r_compliance: Read compliance data