You need to sign in to do that
Don't have an account?
Mellycooks
Filtering Chatter Feed by Group ID AND User ID?
Is there a way to filter a chatter feed by group id and user id using the Chatter API? I want to pull just a specific user's posts out of a group feed.
An example is:
GET /services/data/v33.0/query?q=SELECT+Id+FROM+FeedItem+ ...
Here's the documentation for the query resource (https://www.salesforce.com/us/developer/docs/api_rest/Content/resources_query.htm).
All Answers
I'm not aware of a way to filter a Chatter feed by both group id and user id (at the same time); however, here is an alternative that might achieve a similar result to what you are looking for.
With the Chatter REST API, you can search within a particular group's feed for posts containing the user's name as follows:
/chatter/feeds/record/<group id>/feed-elements?q=firstname+lastname
And here is a useful link with some additional information:
http://www.salesforce.com/us/developer/docs/chatterapi/Content/connect_resource_feeds_record.htm#cc_record_feed_elements
Hope this helps!
:)
SELECT Id, Body FROM FeedItem WHERE ParentId = '<group id>' AND CreatedById = '<user id>'
This returns the Id and Body fields but you can include additional fields in the result set as described in:
https://www.salesforce.com/developer/docs/api/Content/sforce_api_objects_feeditem.htm
And if you would like to work with the Chatter REST API after, you could then pass the ids from the SOQL result to the feed elements batch get resource.
http://www.salesforce.com/us/developer/docs/chatterapi/Content/connect_resources_feed_element_batch.htm
And then if you need the Connect API feed item objects because you need richer, structured information, you can pass the feed item IDs you retrieved from your SOQL query into the ConnectApi.ChatterFeeds.getFeedElementBatch() (https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_ConnectAPI_ChatterFeeds_static_methods.htm#apex_ConnectAPI_ChatterFeeds_getFeedElementBatch_1) method.
If that becomes untennable, I will likely switch to a custom endpoint so that I can filter to my hearts desire. Thanks again!
An example is:
GET /services/data/v33.0/query?q=SELECT+Id+FROM+FeedItem+ ...
Here's the documentation for the query resource (https://www.salesforce.com/us/developer/docs/api_rest/Content/resources_query.htm).