[SalesForce] Get the body of Chatter files

Using Apex, how can I get the body of files uploaded using Chatter? I want to send the document with web service methods.

Best Answer

You need to query FeedItem where the Type is 'ContentPost' and grab the ContentData

SELECT Id, Type, Body, Title, LinkUrl, ContentData, ContentSize, ContentFileName, ContentType From FeedItem where Type = 'ContentPost' order by createddate, ID DESC

Here's the reference doc : http://www.salesforce.com/us/developer/docs/api/Content/sforce_api_objects_feeditem.htm

Related Topic