Reply
Regular Contributor
D_M_C
Posts: 17
0
Accepted Solution

Grab all posts on the main Chatter page (within and outside of groups)

I am trying to move all Chatter activity from one instance to another using the Chatter SOAP API.  I cannot find the SOQL query to grab the posts on the main Chatter page.  Is there a simple query to grab every post on the Chatter page?  If it has to be broken down by User or Group, that's fine.

 

Note: I can create all the required Groups.  I can get a list of all the users and map them over to the other instance.  I just can't get the actual posts from the Chatter page.

Super Contributor
Jia Hu
Posts: 839
0

Re: Grab all posts on the main Chatter page (within and outside of groups)

User FeedItem object to query all the posts in Chatter, it includes the posts on User, Group and Objects,...

http://www.salesforce.com/us/developer/docs/api/Content/sforce_api_objects_feeditem.htm
Regular Contributor
D_M_C
Posts: 17
0

Re: Grab all posts on the main Chatter page (within and outside of groups)

The selected answer is correct.  My issue was that I had the 'ContentData' field in my query and this field seems to poinson all queries.  Removing that element allowed me to get all records.

Super Contributor
Jia Hu
Posts: 839
0

Re: Grab all posts on the main Chatter page (within and outside of groups)

You have to use For Loop if you want to include the ContentData in the query, like

for(Feeditem fi:[Select Body, Title, Type, ContentData from FeedItem Where type = 'ContentPost' limit 5]) {
System.debug(fi.ContentData);
}