Note: This release is in preview. Features described here don’t become generally available until the latest general availability date that Salesforce announces for this release. Before then, and where features are noted as beta, pilot, or developer preview, we can’t guarantee general availability within any particular time frame or at all. Make your purchase decisions only on the basis of generally available products and features.

ConnectApi.CommentInput

Comment input used to add rich comments, for example, comments that include mentions or file attachments.
Property Type Description Required or Optional Available Version
attachment ConnectApi.​FeedItem​AttachmentInput Specifies an attachment for the comment. Valid values are:
  • ContentAttachmentInput
  • NewFileAttachmentInput
LinkAttachmentInput is not permitted for comments. Important: As of version 32.0, use the capabilities property.
Optional 28.0–31.0
body ConnectApi.​MessageBody​Input Description of message body. The body can contain up to 10,000 characters and 25 mentions. Because the character limit can change, clients should make a describeSObjects() call on the FeedItem or FeedComment object and look at the length of the Body or CommentBody field to determine the maximum number of allowed characters.

To edit this property in a comment, use updateComment(communityId, commentId, comment). 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 28.0
capabilities ConnectApi.​CommentCapability​Input Specifies any capabilities for the comment, such as a file attachment. Optional 32.0
threadParentId String ID of the parent comment for a threaded comment. Optional 44.0