Newer Version Available

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

Post a Feed Element

Make a call to post a feed element.
Call postFeedElement(communityId, subjectId, feedElementType, text) to post a string of text.
1ConnectApi.FeedElement feedElement = ConnectApi.ChatterFeeds.postFeedElement(Network.getNetworkId(), '0F9d0000000TreH', ConnectApi.FeedElementType.FeedItem, 'On vacation this week.');

The second parameter, subjectId is the ID of the parent this feed element is posted to. The value can be the ID of a user, group, or record, or the string me to indicate the context user.