1

I am able to get all of chatter feeds by querying 'FeedItem' object.

For example: SELECT Id, Title, Body FROM FeedItem

But, I am getting trouble to get feeds what a specific follow.

Is it possible to use Apex to get the feeds which a user follows?

1 Answer 1

2

You can either find the records a user is following through EntitySubscription, or leverage the NewsFeed which will give you the same Feed Items as what you can find on the home tab.

4
  • The "What I follow" is bigger than " EntitySubscription", and it is not the answer. As one doesn't have any " EntitySubscription", one can still have feeds in the "What I follow". NewsFeed is probably the answer, but it is not supported any more.
    – Cray Kao
    Oct 24, 2016 at 13:42
  • 1
    Not sure I got your point. EntitySubscription will get you all the records and users you are following, so you can then get the Feed Items related to these records even if it could be painful. NewsFeed should be easier, and is still supported by the REST API. Oct 24, 2016 at 14:46
  • Thank you. yes, it is supported by the REST API. I just found a way to get the expected result of "What I follow". But it does not work with SOQL, it is so painful to query the specific post record (feeditem) and its attributes.
    – Cray Kao
    Oct 24, 2016 at 16:13
  • In Apex, you can use the ConnectApi.ChatterFeeds class. Here's an example of getting your news feed: developer.salesforce.com/docs/atlas.en-us.apexcode.meta/…
    – alouie
    Oct 25, 2016 at 5:59

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .