Newer Version Available

This content describes an older version of this product. View Latest

Comments Resources

Get information about, edit, like, or delete a comment. Determine whether the context user can edit a comment.

Available resources:

Resource Description
/chatter/comments/commentId Get information about, edit, or delete a comment.
/chatter/comments/commentId/capabilities​/edit/is-editable-by-me Determines whether the context user can edit a comment.
/chatter/comments/commentId/capabilities​/status Access the status capability of a comment or set the status of a comment.
/chatter/comments/commentId/capabilities​/up-down-vote Get the up and down votes for a comment. Vote a comment up or down.
/chatter/comments/commentId/capabilities​/verified Get the verified status of a comment. Mark a comment as verified or unverified.
/chatter/comments/commentId/likes Get information about the likes for a comment. Like or unlike a comment.

Comment

Get information about, edit, or delete a comment.

Resource
1/chatter/comments/commentId
1/connect/communities/communityId/chatter/comments/commentId
Available since version
23.0
Requires Chatter
Yes
HTTP methods
GET, DELETE, PATCH

PATCH is supported in version 34.0 and later.

Request body for PATCH
Root XML tag
<comment>
Properties
Name Type Description Available Version
attachment Depends on type. Optional. Values are:

As of version 32.0, use the capabilities property.

Important

24.0–31.0
body Message Body Input The body of the comment.

Feed item and comment bodies have a 10,000 character limit. Because this limit can change, we recommend that clients make a describeSObjects() call on the FeedItem or FeedComment object. To determine the maximum number of allowed characters, look at the length of the Body or CommentBody field.

To edit this property in a comment, make a PATCH request to /chatter/comments/commentId. Editing comments is supported in version 34.0 and later.

Rich text and inline images are supported in comment bodies in version 35.0 and later.

23.0
capabilities Comment Capabilities Input Capabilities of the comment, such as a file attachment 32.0
Response body for GET and PATCH
Comment
Example for getting information about a comment
You can find the ID for a specific comment from any feed, such as a news feed or a record feed.
1/chatter/comments/0D7D00000000NtkKAE
Example for editing a comment using the request body
1{   "body":{
2      "messageSegments":[
3         {
4            "type":"Text",
5            "text":"I am definitely going to check that out."
6         }
7      ]
8   }
9}

Comment Capability, Editability

Determines whether the context user can edit a comment.

Resource
1/chatter/comments/commentId/capabilities/edit/is-editable-by-me
1/connect/communities/communityId/chatter/comments/commentId/capabilities/edit/is-editable-by-me
Available since version
34.0
Requires Chatter
Yes
HTTP methods
GET
Response body for GET
Feed Entity Is Editable

If the comment doesn’t support this capability, the response is 404: Not Found.

Comment Likes

Get information about the likes for a comment. Like or unlike a comment.

Resource
1/chatter/comments/commentId/likes
1/connect/communities/communityId/chatter/comments/commentId/likes
Available since version
23.0
Requires Chatter
Yes
HTTP methods
GET, PATCH, POST

PATCH is supported in version 39.0 and later.

Request parameters for GET
Parameter Name Type Description
page Integer Specifies the number of the page you want returned.
pageSize Integer Specifies the number of items per page. Valid values are from 1 through 100. If you don't specify a size, the default is 25.
Response body for GET
Like Page
Request parameters for PATCH
Parameter Name Type Description Required or Optional Available Version
isLikedBy​CurrentUser Boolean Specifies whether the context user likes (true) or unlikes (false) the comment. Required 39.0
Response body for PATCH
Like Page
Request parameters for POST

POST takes no request parameters, nor a request body.

Note

Response body for POST
Like