How to get Chatter Feeds using ConnectApi in Apex Salesforce

H

public List<ConnectApi.FeedItem> getFeedItems()
{
List<ConnectApi.FeedItem> lst = new List<ConnectApi.FeedItem>();

if(!istest)
{
try
{
lst = ConnectApi.ChatterFeeds.getFeedItemsFromFeed(communityId, ConnectApi.FeedType.Record, chatterGroupId).items;
}
catch(Exception ex) { }
}

return lst;
}

 

———————————————–

Where communityId => Use either the ID for a community, internal, or null.

chatterGroupId => ID of the associated CollaborationGroup.

About the author

kalpesh.surana
By kalpesh.surana

Category