Forum Discussion

gandhim's avatar
gandhim
Guide
8 years ago

APi for fetching User details

Hi All,

 

I am new to Lithium Community,  I am trying to figure out if there is any API provided by lithium community to fetch the user details. When I say users it means users/consumers who are registered with the forum. These users can be active or inactive(those who haven't posted/commented anything on the blogs/discussions) on the forums.

 

So can anyone provide me info if any such API exists or if there is any other way to fetch those details?

 

Thanks,

Manpreet

8 Replies

  • Hi Manpreet, 

     

    There are API calls you can make to retrieve certain user details in the community, it would depend on the type of information you're looking to retrieve which API you may want to use.

     

    You can view the Lithium data platform APIs documentation if you have access to that area of the community which outlines the API's available and goes into detail what calls you can make using API v1 and API v2.

     

    If you cannot access the above documentation you'll need to raise a support request with your account manager to get access to this.

     

    I hope this helps,

  • gandhim's avatar
    gandhim
    Guide
    8 years ago

    Thanks for all the replies, I need to do one more thing is to get the details of the users whose profiles are updated on a given day.

    I am trying to get the users which are newly registered (doing that by fetching the users registration time for that day(LIQL)) and the users whose profile has been updated. 
    Is there any LIQL query or an attribute like last modified timestamp which can help me to find out those records.

    Thanks

  • VikasB's avatar
    VikasB
    Boss
    8 years ago

    Hi gandhim 

    Below API will help you to get the users who registered in a specified date range

    To get the list of users registered today( 2017-07-09)
    http:// community.lithium.com/restapi/vc/users/registered
    Parameters:

    date_start=2017-07-09T00:00Z 
    date_end=2017-07-09T23:59Z


    Unfortunately, there is no such API exist to get the list of users on the basis of profile update timestamp.

  • VikasB's avatar
    VikasB
    Boss
    8 years ago

    Hi gandhim  No perfect way to get it using V2.

     

    But you can use a workaround using below API

    SELECT id, registration_data.registration_time FROM users ORDER BY registration_data.registration_time DESC limit N

    Now you need to filter out the records which are registered today using date comparison. 

     

  • gandhim's avatar
    gandhim
    Guide
    8 years ago

    That's good, the problem here is N. We can never be sure how much the value of N should be kept here. Anyways thanks for all your help, I think this information will come in handy.

  • VikasB's avatar
    VikasB
    Boss
    8 years ago

    Hi gandhim You can get the value of N also.

     

    <#assign N = restadmin("/users/registered/count?date_start=2017-06-09T00:00Z&date_end=2017-07-09T23:59Z").value>

    Use N as a limit

    <#assign NewUsers= restadmin("2.0","/search?q=" + "SELECT id, registration_data.registration_time FROM users ORDER BY registration_data.registration_time DESC limit ${N}"?url).data.items /> 

    Hope it would resolve your problem.