Newer Version Available

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

Comment

Get information about, edit, or delete a comment.

To post a comment, use Feed Elements Capability, Comments Items.

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

PATCH is supported in version 34.0 and later to edit a comment’s body. PATCH can’t be used to update a comment’s capabilities.

Request body for PATCH
Root XML tag
<comment>
JSON example for editing a comment
1{   "body":{
2      "messageSegments":[
3         {
4            "type":"Text",
5            "text":"I am definitely going to check that out."
6         }
7      ]
8   }
9}
Properties
Name Type Description Required or Optional Available Version
attachment Depends on type. Values are:

As of version 32.0, use the capabilities property.

Important

Optional 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. Inline images in content bodies must use content document (069) image files previously uploaded to Salesforce. Entity links are supported in version 43.0 and later.

Required 23.0
capabilities Comment Capabilities Input Capabilities of the comment, such as a file attachment.

You can edit a comment’s body, but you can’t update a comment’s capabilities.

Optional 32.0
threadParentId String ID of the parent comment for a threaded comment. Optional 44.0
Response body for GET and PATCH
Comment
Response body for DELETE
204: Successful Delete