If a top level comment has nested comments, the commentsSummary.selectedComments array provides a preview of the two most recent nested comments.

Note

We recommend:

Getting a summary of social actions before attempting to fetch comments or likes for a share directly. If there are no comments or likes for a share, a request to fetch comments or shares returns 404 - Not Found.

Setting the page count to less than 200 when you fetch shares to prevent timeouts.

Retrieve Comments on Comments

To resolve nested comments for a given parent comment, provide a parent commentUrn as the target in the request URL. A commentUrn is a composite URN constructed using a comment ID and activityUrn.

Sample Request

GET https://api.linkedin.com/v2/socialActions/urn:li:comment:(activity:6273189577469632512,6275822846992351232)/comments

Sample Request Body

Use the ID returned in the response header to take further action on the newly created comment. The following response body also contains a comment URN which can be used as parent comment for creating nested comments.

Comment Mentioning

Comment text may contain attributes, which are links to other LinkedIn entities such as people or organizations. Mentioning requires knowledge of the URN for the referenced entity. You must also specify the part of the comment text that should be rendered as a link to the entity.

Schema

Field

Description

Format

Required

length

The length of the annotation link

integer

yes

start

The starting character index beginning the annotation link

integer

yes

value

An object that includes the URN of the organization or member you want to mention in the comment.

Create a Like on a Share

Sample Request

Use the object field in the request body to specify the URN of the entity to which the like belongs. This object should be a sub-entity of the top-level share indicated in the request URL, and should be represented as a URN of format urn:li:share:{id}.

The actor field in the request body is used to specify the entity performing the action. It should be represented by a urn:li:person:{id} or urn:li:organization:{id} URN.