Forum Discussion

dhiraj_gophane's avatar
12 years ago

Rest call to retrieve number of users visited in given time period

hi,

I was using the following REST api to retrieve number of users visited in given time period.

endpoint:  http://<community-name>.stage.lithium.com/restapi/vc/users/visited?date_start=2013-06-29T00:00Z&date_end=2013-06-29T23:59Z

(you can change Date and Time)

 

It gives all the users who visited on that day.
But if any user logins after this time period then that user is not included in this list again when we do the same call.
Meaning, it only considers the last login of an user.

so does anyone have any other way to get the list of users who visited in particular time period??

  • JakeS's avatar
    JakeS
    12 years ago
    Dhiraj, I'm going to try replicating this, if that is how the call is working it sounds like a bug.

7 Replies

  • JakeS's avatar
    JakeS
    Lithium Alumni (Retired)
    12 years ago
    Hi Dhiraj, I want to make sure I understand your case; are you making this query during the time period between the start and end dates, i.e. in your example you would make that query some time during 2013-06-29? And are you referring to users who log in after the end of the time period, or after you make the query?
  • hi Jake,
    I am making the call after the time period only.
    i.e. after the date_end parameter.
    but if the user logins "after the end of time period" then the user is excluded from the response even if he was logged in within that time period.

    example:
    if user-A logins on date 2013-06-29 and again if he logins on 2013-06-30.
    Then if I make a call to retrieve users visited on date 2013-06-29, then User-A should be there, right?
    but if I make a call using following API then I don't get User-A in the response.
    This is because User-A logins on 2013-06-30.


    API call to get Active users within given timeframe (also gives some limited user metrics)

    Endpoint: http:// <community_name>.stage.lithium.com/restapi/vc/users/visited

    Parameters:

    date_start=2013-06-29T00:00Z (you can change the dates)
    date_end=2013-06-29T23:59Z
  • JakeS's avatar
    JakeS
    Lithium Alumni (Retired)
    12 years ago
    Dhiraj, I'm going to try replicating this, if that is how the call is working it sounds like a bug.
  • ok Jake,
    that sounds good.
    thanks for your follow up.
    I really appreciate your interest in this issue.
    thanks.
  • JakeS's avatar
    JakeS
    Lithium Alumni (Retired)
    12 years ago

    Dhiraj,

     

    After looking into this, it seems the call just isn't meant to be used this way; the user's login time is only tracked for their last session, and this is the information used to put together the list for the users/visited call.  The documentation on this might just need to be updated to clarify, but as of now there is no support for tracking which users logged in during a given time period.

     

    I'm sorry there isn't a call to support this exact use case, but if you don't need the actual identities of the users who logged in during a given time, but just want to know the number, there may be a metrics call you could use, or else there may be some way to retrieve information on an individual user's logins.  If you'd like I can try to look into one of these alternate methods of getting user login info, I just don't think that you'll be able to get the exact information you expected from the users/visited call in that format.

     

    Best,

    Jake Scheps

  • hey jake,
    I want to retrieve some of the information of users who have logged in in a given time period.
    so it is necessary to have their identities.
    i understood as you said the call doesn't work as it is mentioned.
    So I highly recommend to update the documentation.
    I also want to request if we can have a new call which will do the need full.
    Can you please do something regarding this?
  • JakeS's avatar
    JakeS
    Lithium Alumni (Retired)
    12 years ago

    Hi Dhiraj,

     

    If that is your exact use case, then it's not currently supported; however you should definitely post your request to the idea board so that it's in the system and it can be considered for implementation.

     

    Thanks,

    Jake Scheps