Forum Discussion

peterlu's avatar
peterlu
Champion
11 years ago

API v2 - get users with certain roles who are recently active in community

Hi All,

 

I would like to fetch 10 unique users who have one of these certain roles (RoleA, RoleB, RoleC,... RoleZ) and also recently posting (forum/tkb/blog etc) in the community.

 

possible in v2 query? (not necessarily by single query)

 

Peter

1 Reply

  • Hey peterlu I know we can get users with specific roles via the V2 API:

    SELECT * FROM users WHERE roles.name IN ('Administrator', 'Community Manager')

     And the user object supports metrics. Including post count.

     

    SELECT login,metrics.posts FROM users WHERE roles.name IN ('Administrator', 'Community Manager')

     Which sucessfully returns a 200 code in the browser, but doesn't have an actual count.

     

    Maybe there's another object under the metrics.posts which needs to be referenced?

    I've found a tonne of metrics which return a 200 code, but no actual value in the JSON.