Forum Discussion

mayank's avatar
11 years ago

fetch last login users using rest api

i want to fetch last login users using rest api

  • Hi Mayank,

    I think you are talking about logged in users for a particular time range.

     

    You can use following rest api.

     

    API call to get logged in users within given timeframe (also gives some limited user metrics)
    Endpoint: http:// community.lithium.com/restapi/vc/users/visited
    Parameters:

    date_start=2013-06-26T00:00Z (you can change the dates)
    date_end=2013-06-26T23:59Z
    restapi.response_style (optional): view
    restapi.format_detail (optional): full_list_element

     

    Hope its helpful.

    If so please accept it as solution.

  • Hi,

     

    use the following code to pull the current online users:

    http://community.abc.com/restapi/vc/users/online

    ...it might make sense to only show registered users (e.g. exclude anonymous logins):

    http://community.abc.com/restapi/vc/users/online/registered

    ...and you can use the page_size argument again to limit the number of users returned:

    http://community.abc.com/restapi/vc/users/online/registered?page_size=10

    I have to admit though that I don't know how have them show up ordered by latest login with latest logins first. From what I can tell the order is pretty random.

    • mayank's avatar
      mayank
      Ace

      Thanks for telling different api methods

       

       

      I want to see basic things like how many users joined the community based on date ranges

       

      .Is lithium provide any method for that?..

      • Hi Mayank,

        I think you are talking about logged in users for a particular time range.

         

        You can use following rest api.

         

        API call to get logged in users within given timeframe (also gives some limited user metrics)
        Endpoint: http:// community.lithium.com/restapi/vc/users/visited
        Parameters:

        date_start=2013-06-26T00:00Z (you can change the dates)
        date_end=2013-06-26T23:59Z
        restapi.response_style (optional): view
        restapi.format_detail (optional): full_list_element

         

        Hope its helpful.

        If so please accept it as solution.