Public
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Guide

LiQL query giving different count

Hi Guys,

 

I'm using REST-API to find the count of users with the help of LiQL query.

but sometimes it is giving me as 278382 and sometimes it is giving me as 283847.

 

it is s everytime swapping from 278382 to 283847 or vice-versa.

 

do you have any idea why this is happening?

 

Thanks in Advance.

8 Replies 8
Director

@hpanmand -  Could you please provide me the API call which you are using?

Payal Uppal

That query is too broad so it will always fail. From the documentation "This must be constrained by the online_status parameter in the WHERE clause." 

So this would work:

SELECT count(*) FROM users WHERE online_status = 'online'

 

So for what you need I would use API 1:

https://community.lithium.com/t5/Developer-Documentation/bd-p/dev-doc-portal?section=commv1&leaf-id=...

http://community.lithium.com/community-name/restapi/vc/users/count

Dropbox Community Developer
Check out our submission for the 2022 Customer Awards and please consider giving us a Kudos!

Can you please help me to understand how to use

http://community.lithium.com/community-name/restapi/vc/users/count

 

can you please give me an example so that would be great help.

If you want to use it to just get the actual figure, you just change the URL to contain your community info and paste it into your browser. It displays as an xml page with no styling.

For example:

http://[your community home page url].com/[your community name]/restapi/vc/users/count

 

However if you want to use it in a custom component, this post explains how to use the REST API in a custom component - https://community.lithium.com/t5/Developer-Knowledge-Base/Component-tutorial-Building-your-first-cus...


Dropbox Community Developer
Check out our submission for the 2022 Customer Awards and please consider giving us a Kudos!

is there any way in V2 REST-API by which we can find the count of users?

Not that I know of, sorry @hpanmand!


Dropbox Community Developer
Check out our submission for the 2022 Customer Awards and please consider giving us a Kudos!

okay @SheenaK

Welcome to the Technology board!

Curious about our platform? Looking to connect on social technology? You've come to the right place!

Are you a Khoros customer? For direct assistance from our Support team, please visit the Support Forum.