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

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
Highlighted
Honored Contributor

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

Highlighted
Trusted Contributor

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
Highlighted

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.

Highlighted
Trusted Contributor

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...

Highlighted

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

Highlighted
Trusted Contributor

Not that I know of, sorry @hpanmand!

Highlighted

okay @SheenaK