create(), delete(), describeSObjects(), query(), retrieve(), update(), upsert()
//create and insert post FeedItem post = new FeedItem(); post.Body = 'HelloThere'; post.ParentId = 'ID_OF_LEAD_ENTITY'; post.Title = 'FileName'; insert post;
//create and associate a content attachment to the post FeedAttachment feedAttachment = new FeedAttachment(); feedAttachment.FeedEntityId = post.Id; feedAttachment.RecordId = 'ID_OF_CONTENT_VERSION'; feedAttachment.Title = 'FileName'; feedAttachment.Type = 'CONTENT'; insert feedAttachment;
SELECT Id FROM FeedAttachment WHERE FeedEntityId = 'some_feedItem_id'
SELECT Body, (SELECT RecordId, Title, Type, Value FROM FeedAttachments) FROM FeedItem WHERE Id = 'some_feedItem_id'