Newer Version Available

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

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 one 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:

As of API version 32.0, use the capabilities property.

Important

Optional
body Message Body Input Description of message body. The body can contain up to 25 mentions.

If you specify originalFeedItemId to share a feed item, use the body property to add a comment to the feed item.

If this feed item is shared, this value is the body of the first comment.

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
isBookmarked​ByCurrentUser Boolean Specifies if the new feed item should be bookmarked for the user (true) or not (false). Default value is false.

As of API version 32.0, use the capabilities.bookmarks.​isBookmarkedByCurrentUser property.

Important

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 If this feed element is shared, this is the original feed element 18-character ID.

This parameter takes precedence over all other parameters. For example, if you share a post and also try to upload a file, the generated feed-item only contains the shared post. You should only share a post or upload a file, not both in the same post.

Note

Optional 31.0
originalFeedItemId String If this feed item is shared, this is the original feed item 18-character ID.

As of API version 32.0, use the originalFeedElementId property.

Important

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.
If the parent of the feed item is a User or a Group, the visibility of the feed item must be AllUsers.
Optional 26.0