Forum Discussion

khill's avatar
khill
Mentor
8 years ago

Bulk Kudos by Kudo Given Date Range and Message ID

Hi everyone,

 

Does anyone know how to use API or admin reports to pull a list of all kudos given by Message ID over a date range?  Using the API documentation I can only find this info for a certain Message ID, but what I would ideally like is a list of all messages that received kudos (and their associated kudo info) over a date range so that I can import it into my on-premise BI solution.

 

Thanks in advance for your help as always!

Kate

  • khill - I don't think there is a where clause in API V2 which can fetch messages for kudos given a date.  

     

    Kudos call only support - images.id, message.author.id, message.id,user.id as a where clause. 

    With the messages call you can get kudos count and a message id same as your format, however, you only can fetch messages for certain date range by its post time, not by kudos given a date. 

5 Replies

  • khill's avatar
    khill
    Mentor
    8 years ago

    Hi AbhishekIlindra - Yep, so my issue with the standard reports is that (from what I can find so far) they provide kudos by date only (in admin report) or by single message ID only (in API) and I need message ID to match in my database.  What I want is to extract a table that would look something like:

     

    Message ID|#Kudos

    11111 | 2

    11112 | 1

    11114 | 3

     

    etc. over all posts that received kudos within a certain date range.

     

    Any ideas?

     

    Kate

  • khill - I don't think there is a where clause in API V2 which can fetch messages for kudos given a date.  

     

    Kudos call only support - images.id, message.author.id, message.id,user.id as a where clause. 

    With the messages call you can get kudos count and a message id same as your format, however, you only can fetch messages for certain date range by its post time, not by kudos given a date. 

  • khill's avatar
    khill
    Mentor
    8 years ago

    Hi TariqHussain,

     

    Thanks (as always) for your help, I am not sure what I would do without you!  Okay so with your guidance I have gotten to the LiQL call that provides message ID and sum of kudos which gets me pretty close to what I need.

     

    SELECT kudos.sum(weight), id from messages

     

    Trying to think of some work around ideas for getting more kudo info...  there isn't a way to add kudo ID to this call is there?  I don't think there is, but just in case!

  • khill - To get more info regarding the kudos, you can use two queries. 

     

    The first query will fetch the messages and while looping through these messages, you can run the second query to fetch the kudos details for that particular message.  E.g 

     

    Just an example script:- 

     

     

    <#assign messages = rest("2.0","/search?q=" + "SELECT kudos.sum(weight),id from messages"?url).data.items![] />
    <#list messages as message>
    <#assign kudosDetail = rest("2.0","/search?q=" + "select time,user.id from kudos where message.id = '${message.id}' "?url).data.items![] /> </#list>

     

     

    The kudosDetails query will fetch more details e.g time.

     

    Only a few details are mapped with kudos, you can see it here https://community.lithium.com/t5/Developer-Documentation/bd-p/dev-doc-portal?section=commv2&collection=kudos#constraints-message.id

     

    Documentation for the first query https://community.lithium.com/t5/Developer-Documentation/bd-p/dev-doc-portal?section=commv2&collection=messages#fields-kudos