Newer Version Available
Feed Item Input
- Root XML tag
- <feedItem>
- JSON
- The following example attaches a poll to a feed
item:
1{ 2 "body":{ 3 "messageSegments":[ 4 { 5 "type":"Text", 6 "text":"When should we meet for release planning?" 7 } 8 ] 9 }, 10 "capabilities":{ 11 "poll":{ 12 "choices":[ 13 "Monday", 14 "Tuesday" 15 ] 16 } 17 }, 18 "feedElementType":"FeedItem", 19 "subjectId":"me" 20} - Feed items support more than 1 capability. The following example attaches a file
to a feed item and bookmarks
it.
1{ 2 "body":{ 3 "messageSegments":[ 4 { 5 "type":"Text", 6 "text":"Check out the latest marketing collateral." 7 } 8 ] 9 }, 10 "capabilities":{ 11 "bookmarks":{ 12 "isBookmarkedByCurrentUser": true 13 }, 14 "content":{ 15 "contentDocumentId": "069D00000001uQO" 16 } 17 }, 18 "feedElementType":"FeedItem", 19 "subjectId":"me" 20} - Properties
-
Name Type Description Required or Optional Available Version attachment Depends on type. You can specify only one of these values in the attachment parameter. Values are: - Attachment Input: Canvas App (v29.0–31.0)
- Attachment Input: Existing Content (v23.0–31.0)
- Attachment Input: Feed Poll (v26.0–31.0)
- Attachment Input: Link (v23.0–31.0)
- Attachment Input: New File Upload (v23.0–31.0)
Optional body Message Body Input Description of message body. Feed item and comment bodies have a 10,000 character limit. Because this 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. The body can contain up to 25 mentions. If you specify originalFeedElementId to share a feed item, use the body property to add the first comment to the feed item.
To edit this property in a feed item, make a PATCH request to /chatter/feed-elements/feedElementId. Editing feed posts is supported in version 34.0 and later.
Required unless the feed item has a content capability or a link capability 23.0 capabilities Feed Element Capabilities Input The capabilities that define the behavior of this feed element. Optional 31.0 isBookmarkedByCurrentUser Boolean Specifies whether to bookmark the new feed item for the user (true) or not (false). The default value is false. Optional 24.0–31.0 feedElementType String The type of feed element this input represents. The only valid value is FeedItem.
Required 31.0 originalFeedElementId String To share a feed element, specify its 18-character ID. Optional 31.0 originalFeedItemId String To share a feed item, specify its 18-character ID. Optional 24.0–31.0 subjectId String The ID of the parent this feed element is being posted to. This value can be the ID of a user, group, or record, or the string me to indicate the context user. Required 31.0 visibility String Who can see the post. Valid values are: - InternalUsers—If Communities is enabled, only members of the default, internal community can see the feed item.
- AllUsers—If Communities is enabled, all members of the community can see the feed item.
Default values:- For external users, the default value is AllUsers. External users must use this value to see their posts.
- For internal users, the default value is InternalUsers. Internal users can accept this value or use the value AllUsers to allow external users to see their posts.
Optional 26.0