Forum Discussion

bkling's avatar
bkling
Boss
12 years ago

Derive average Time to first Reply/Post by a specific user for specific date range

Hi all, we are looking to pull some measures to identify Advocates who are very responsive to our user base.  We'll do some other pulls to get a potential candidate list.

 

What I would like to be able to do is:

  1. Specify username
  2. Specify date range
  3. For those threads where the user has participated (any messages/replies, NOT Topics), pull average time from original Author's post of Topic to specified user's first post in the thread.

 

Looking to validate/measure responsiveness of specific users.

 

Can REST API query do this and if so can anyone help with the query needed?

  • AdamN's avatar
    AdamN
    Khoros Oracle

    Hi Brian,

     

    There's not a single REST API call that will do this; however, you should be able to calculate it with a series of calls.

     

    One possible approach...

     

    Start with getting all of the messages for the specified user in the specified date range. You can do this via REST API message search call, with specifying the user id and the time range as second since epoch. For example, here is a call for all of the messages I've posted on the Lithosphere between now and 1 month ago:

    http://lithosphere.lithium.com/restapi/vc/search/messages?q=date:[1346772203 TO 1349364211]&author_id=15

     

    Please note that I've left the query string parameters unencoded for readability, but it's always a good idea to URL encode your query string parameter values.

     

    Once you have the list of messages, you can look at each one for the date of the reply:

    <post_time type="date_time">2012-09-10T19:41:55+00:00</post_time>

    as well as the root message:

    <root type="message" href="/messages/id/59154"/>

     

    You could then make another REST API call to get the details of that root message (such as the author and post date):

    http://lithosphere.lithium.com/restapi/vc/messages/id/59154

     

    There may be some additional analysis that you may need to do such as checking to see if the reply author and the root author are the same (user replied to their own thread) or checking which reply is first (user replied to the same thread more than once), but these REST API calls should hopefully give you all the details you need to work with.

     

    I hope this helps!

     

    -Adam