Activities

Try in Postman

The Activities API resolves an Activity URN into the underlying DomainEntity, such as a Share, UGC Post, Comment, Article, Group Post, or Instant Repost. This API returns no personal data and is scoped strictly to DMA-approved activity types.

Overview

An Activity represents an action performed by a LinkedIn member on content. Each activity is uniquely identified by:

urn:li:activity:{id}

The Activities API performs a Batch_Get to resolve one or more Activity URNs into their corresponding underlying entity URNs.

Activity Page Example

Activity Example

Supported Activity Types

The Activities API can resolve Activity URNs that correspond to the following types of LinkedIn content:

  • Like - Reactions to posts or content
  • Share - Reshared content
  • Comment - Comments on posts
  • GroupPost - Posts within LinkedIn groups
  • UgcPost - User-generated content posts
  • LinkedinArticle - Published LinkedIn articles
  • InstantRepost - Quick reposts of content

For activities that correspond to unsupported content types (such as Reactions), the API will return an HTTP 403 error with the message Activity's verb type is not allowed from the ActivityFilter.

Schema

Field Format Description Required
ids List of urn:li:activity:{id} Activity URN(s) to resolve Yes
domainEntity URN Underlying content object Returned when allowed

URNs must match: urn:li:activity:[0-9]+

Member Data Obfuscation

Member data obfuscation is performed per activity level to see if an activity's author is opted in or out for sharing their data. The DomainEntity field will be empty when the author is opted out for sharing their data.

How to Use the API (Usability Guide)

Locate the Activity URN

Activity URNs can be obtained from LinkedIn feed URLs:

  1. Navigate to a LinkedIn post or activity on linkedin.com
  2. Click on the three dots menu (⋯) on the post
  3. Select "Copy link to post" from the menu
  4. The copied URL will be in the format: https://www.linkedin.com/feed/update/urn:li:activity:{id}
  5. Extract the activity URN portion: urn:li:activity:{id}

Example from a feed URL:

https://www.linkedin.com/feed/update/urn:li:activity:{id}

Extract:

urn:li:activity:{id}

Retrieve Activity Details

Sample Request

GET https://api.linkedin.com/rest/dmaActivities?ids=List(urn%3Ali%3Aactivity%3A{id})

Headers:

Authorization: Bearer {ACCESS_TOKEN}
Linkedin-Version: YYYYMM
X-Restli-Protocol-Version: 2.0.0

Sample Response

{
  "results": {
    "urn:li:activity:{id}": {
      "domainEntity": "urn:li:groupPost:9054972-{id}"
    }
  },
  "statuses": {
    "urn:li:activity:{id}": 200
  },
  "errors": {}
}

Batch Request - Multiple Activities

To retrieve multiple activities in a single request, provide a comma-separated list of activity URNs in the ids parameter.

Sample Batch Request

GET https://api.linkedin.com/rest/dmaActivities?ids=List(urn%3Ali%3Aactivity%3A{id1},urn%3Ali%3Aactivity%3A{id2},urn%3Ali%3Aactivity%3A{id3})

Headers:

Authorization: Bearer {ACCESS_TOKEN}
Linkedin-Version: YYYYMM
X-Restli-Protocol-Version: 2.0.0

Sample Batch Response

{
  "results": {
    "urn:li:activity:{id1}": {
      "domainEntity": "urn:li:share:{id}"
    },
    "urn:li:activity:{id2}": {
      "domainEntity": "urn:li:groupPost:9054972-{id}"
    },
    "urn:li:activity:{id3}": {
      "domainEntity": "urn:li:share:{id}"
    }
  },
  "statuses": {
    "urn:li:activity:{id1}": 200,
    "urn:li:activity:{id2}": 200,
    "urn:li:activity:{id3}": 200
  },
  "errors": {}
}

Interpret the DomainEntity

  • domainEntity points to the content that triggered the activity.
  • Fetch underlying content using the corresponding API.

Query Parameters

Field Name Type Description Required Example
ids URN for the activity Activity URN, must follow the regex urn:li:activity:[0-9]+ Yes urn:li:activity:123456789

API Error Details

HTTP Status Code ERROR MESSAGE DESCRIPTION ERROR RESOLUTION
400 Invalid id/urn provided. URN must be provided as urn:li:activity The requested URN is not an ActivityUrn. ActivityUrn must match regex urn:li:activity:[0-9]+.
403 FORBIDDEN The requested Activity URN is restricted to be viewed/accessed. Make sure your developer application is provisioned with the required permissions.
403 Activity's verb type is not allowed from the ActivityFilter The activity corresponds to a content type that is not supported by this API. See the "Supported Activity Types" section for supported content types. Use only activities that correspond to supported content types.
404 Could not find activity for given activity URN The requested Activity URN does not exist. Make sure the Activity URN is correct.
500 INTERNAL_SERVER_ERROR Internal server-side error. N/A