Forum Discussion
- OlivierSLithium Alumni (Retired)
vishwajeet_hol here is the API v2 call (but it doesn't sort by post count):
SELECT id, login FROM users WHERE roles.name='Administrator' SELECT * FROM users WHERE roles.name IN ('Administrator', 'Community Manager')
And here is the user resource documentation.
OlivierS Is there any other call which will sort by post count.
vishwajit_shind You can count the entire Message collection or filter the message count based on any field supported in the WHERE clause. The count(*) field can only be returned; it is not supported in a WHERE or ORDER BY clause. ORDER BY, LIMIT, and OFFSET have no effect on count(*).
For example,
SELECT count(*) FROM messages LIMIT 10 will ignore the limit. In addition, count(*) cannot be used in a partial response.
For example,
SELECT count(*), id, subject FROM messages WHERE author.login = 'SusanH' is not supported.
The message count returned will be exact when the query is scoped to board.id in the WHERE clause.
Queries scoped to other fields, queries that filter by multiple fields (including board.id), and unscoped queries will return a close estimation to the actual count. Examples of queries that will return estimated counts include:
SELECT count(*) FROM messages SELECT count(*) FROM messages WHERE author.login = 'SusanH' SELECT count(*) FROM messages WHERE board.id = 'developerForum' AND author.name = 'SusanH'
Source: http://community.lithium.com/t5/Community-API-v2/Message-resource/ta-p/113091
Related Content
- 10 months ago
- 2 years ago