0% found this document useful (0 votes)
686 views3 pages

View Count For FeedItem

We cannot reliably use the ConnectApi getReadByForFeedElement() method to get the actual view count for a feed item. [1] This method returns very limited data that does not match the view count shown in the UI. [2] There is no method that directly returns the exact view count. [3] The ConnectAPI has a limit of 2000 batches per user per hour that could easily be exceeded when making calls on topic detail pages.

Uploaded by

pratik kute
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
686 views3 pages

View Count For FeedItem

We cannot reliably use the ConnectApi getReadByForFeedElement() method to get the actual view count for a feed item. [1] This method returns very limited data that does not match the view count shown in the UI. [2] There is no method that directly returns the exact view count. [3] The ConnectAPI has a limit of 2000 batches per user per hour that could easily be exceeded when making calls on topic detail pages.

Uploaded by

pratik kute
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

View Count For FeedItem

We want to find view count for an feedItem as per standard topic detail page.

To find this we are using below method.

1) getReadByForFeedElement(String networkId, String FeedId)

Ex:
ConnectApi.ReadByPage userData =
ConnectApi.ChatterFeeds.getReadByForFeedElement('0DB0P000000U1Hq',
‘0D52900000UQpE5CAL’);
System.debug('userData***' + userData);

- But there is huge difference in Data returned by this method Vs actual


view count
- For Ex: I passed one feedId as a parameter, Its actual View Count on UI is
162 & count returned by this method is 6.

Conclusion :

We cannot use getReadByForFeedElement() method as data returned by this


method is very limited in scope & the actual view count is totally different.

To get the more information about view count & read functionality, we
raised a case with salesforce. Please find below questions & responses
from them.
1. Method 'getReadByForFeedElement', get information about who read a
feed element and when

Salesforce :

With a couple of exceptions, only people with access to a private or


unlisted group can see all information. Users with Modify All Data or
View All Data permission can see information in all feeds. Such users
can also get the information using API calls. Please ensure the user
has Modify All Data or View All Data permission and verify.

Team :

We have tried above method in terms of System Admin profile context who
has View All Data & Modify All Data, But it Didn’t give us expected result.

2. What is the exact connect api call limit per user per day

Salesforce :

ConnectAPI limit of 2000 batches per user, per hour

https://help.salesforce.com/articleView?id=000316318&language=en_US&t
ype=1&mode=1

Salesforce Suggested to use Interaction capability, but they also


don’t know how we can use in real scenario.
PFB latest reply from salesforce.

Salesforce :

 Hi Avanish and Team, I didn't find any examples , however i will check
and update you as soon as possible Regards, Ram
By Salesforce Support on 2019-09-12 07:28:46
What are the possibilities to Hit the connect API
Limit..?

As per salesforce documentation, connect API has 2000 batch per hour per
user limit.(
https://help.salesforce.com/articleView?id=000316318&language=en_US&t
ype=1&mode=1)

Till now we didn’t get any method that will fetch the exact view count for a
particular feed Item , But even if we get that method in future, there is high
chance that user can hit this limit because we have to make that much
connect API call as no of questions visible per page at a time.

Along with this, we also have implemented server side pagination.

PFB Scenario’s where every click on topic detail page, server call will happen
& entire logic will be executed again

1) If user click on next/prev button for pagination purpose,


2) User click on any of the question filter or sort filter
3) User click on the question & again came to topic detail page,
4) User click on dropdown menu to change the no of questions per page
5) If user refreshes the current page

Apart from this, above mentioned API limit is per hour per user Limit. So other user
stories like Home page, Whats New , Ask A Button ..etc Or any future user stories
API calls that also be counted in the final user API count.

You might also like