Count of Popular topics at Category level
Hi All ,
How can I get a count of popular topics at category level or Is it possible to get the number of messages in kudoed message leaderboard. I am trying to a custom component for popular topics in forum (most kudoed) using ,
kudos/messages/leaderboard
However I need to paginate this , for which I am using Lithium's in built pagination component which requires a total count of all the messages in leaderboard.
Thanks,
Sam
Hi Sam,
Are you trying to get a count of messages that have kudos in a category, or are you trying to get a sum of all the kudos given in a category?
If the former, you could probably do a search for messages in the category that have kudos, using the "has_kudos" filter. For example:
/restapi/vc/search/messages/count?location=category%3ADeveloper&has_kudos=true&collapse_discussion=false
This would give you count of all of the messages in the "Developer" category that have kudos. To get the actual messages, you could just remove the "/count" path parameter.
If you're wanting a sum of all the kudos instead, you could probably do so using the metrics call for a category:
You would just need to determine the name of the metric (you can find this in the admin) and the desired time range.