Forum Discussion

samudhraa's avatar
samudhraa
Expert
11 years ago

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 topi...
  • AdamN's avatar
    11 years ago

    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:

    http://lithosphere.lithium.com/t5/rest-api/bd-p/developers-rest-api?leaf-id=Category.metrics#Category.metrics

    You would just need to determine the name of the metric (you can find this in the admin) and the desired time range.