Forum Discussion

kandulmadhu's avatar
10 years ago

Count of kudo givers to a particular post

Hi,

 

Following is the REST API for getting the kudo given users list for a particular post:

/boards/id//messages/id//kudos/givers

 

I need the total count of kudo givers to a particular post.

Is there any REST API call for the same?

 

Regards,

Madhu

  • DougS's avatar
    DougS
    Khoros Oracle

    You can make a REST V1 call like the following to get a count of the total number of kudos given to a particular message:

     

    http://community.lithium.com/community-name/restapi/vc/messages/id/187/kudos/count

    (see http://community.lithium.com/t5/Community-API/bd-p/developers-rest-api?leaf-id=Message.kudos.count#Message.kudos.count for more information on the kudos count call)

     

    You could also make a REST V2 call with a LiQL statement like the following:

     

    SELECT * FROM kudos WHERE message.id='187'

    (see http://community.lithium.com/t5/Community-API-v2/Kudo-resource/ta-p/123853 for more information on the REST V2 kudos resource)

    • kandulmadhu's avatar
      kandulmadhu
      Advisor

      Hi DougS,

      Thanks for replying.

       

      The V1 call you mentioned would return the count of kudos for that post but I need the count of users that gave kudos to a particular post.

       

      The count of kudos may not be equal to the count of users that gave kudos because of the feature called overriden kudos weight.

      Sometimes, a post may have 1500 kudos but may be only one user gave those kudos by overriding his kudo weight as 1500.

       

      And, the v2 call you mentioned would return the same.

      I could the size here, but as by default only 25 records are returned in response, I may want to limit it to 1000(as it is the highest value).

      But, this could cause a problem for me in cases where kudo givers are more than 1000.

       

      Could you help me out here.

      Thanks in advance,

      Madhu