Newer Version Available

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

Feed Items Comments

Access comments for a specific feed item or post a comment.

The default number of comments to retrieve is 3. To retrieve more comments increase the size of the pageSize parameter.

For additional information about posting a comment, see Using POST, PATCH, or PUT for Input.

To upload a binary file to attach to a comment, you must send it in a multipart/form-data request. To send the text of the comment, you can choose to include a JSON or XML rich input body part in the multipart/form-data request. Alternately, you can choose to pass the information in request parameter parts. For information about how to create the multipart/form-data message, see Uploading Binary Files.

Comments can contain up to 5000 characters.

Resource
1/chatter/feed-items/feedItemId/comments
Available since version
23.0
HTTP methods
GET, POST or HEAD
Request body for POST
Root XML tag
<comment>
Properties
Name Type Description Available Version
attachment Depends on type. Optional. Values are: 24.0
body Message Body Input Description of message body 23.0
Request parameters for POST
Parameters for attaching an existing file
Parameter Name Type Description Required or Optional Available Version
attachmentType String The type of attachment. Must contain the value ExistingContent. Required 27.0
contentDocumentId String ID of an existing file to be posted. Required 24.0
text String Text of the comment. Optional 23.0
Parameters for posting text
Parameter Name Type Description Required or Optional Available Version
text String The comment text. Required 23.0
Request parameters for GET or HEAD
Parameter Name Type Description Required or Optional Available Version
page String A generated token that indicates the view of feed items in the feed. Page tokens are returned as part of the response body, in one of the URL parameters, such as nextPageURL. Optional 23.0
pageSize Integer Specifies the number of items per page. Valid values are between 1 and 100. If you don't specify a size, the default is 25.

This parameter specifies the number of comments per page.

Optional 23.0
Response body for GET or HEAD
Comment Page
Response body for POST
Comment
Example: Posting a Comment
This POST request uses a request parameter to post a comment to a feed item:
1/chatter/feed-items/0D5D0000000JvckKAC/comments?text=I+completely+agree
Example: Posting a Comment and Attaching an Existing File
This POST request posts a comment and attaches a file that has already been uploaded to the user’s organization:
1/chatter/feed-items/0D5D0000000JvckKAC/comments?text=yes&attachmentType=ExistingContent&contentDocumentId=069D00000001FHF
Example: Posting a Comment and Uploading and Attaching a New File
See Uploading Binary Files.