Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How do I get a list of active Confluence users through the Rest API?

Deleted user December 23, 2016

All of our users are in confluence-users so that's a simplifying assumption we can use. I wrote a script to pull out all the users using <url>/rest/api/group<group name>/member and I certainly got a list.

To my chagrin I discovered that the list makes no distinction between Active and Inactive users. So I can then call the <url>/rest/api/user?username=<username> api to get more information, right?

But it doesn't tell me if the user is active or inactive, either!

From exploring these forums I gather that there is no better way (using the rest api) to get a list of users so my best hope is to find a way to determine if a user is active or inactive.

Is there a way to do that!?

I'm on Confluence Server if that makes a difference.

 

2 answers

1 vote
Deleted user December 29, 2016

There is a way to do this, sort of, without creating a new REST API.

First off, understand that there is no way to get USERS through the API: you can only get users in a group.

If you get the users from the confluence-users group that will probably be all the users on your system (this is true of our system).

The way you find out if this is true for you is to look in the global permission: <your_URL>/admin/permissions/globalpermissions.action. This will list the groups that have all the users who can actually do anything. There may be users on your system who are not in any of these groups but they have no access to anything (and they don't count against licensing).

My problem: some of the users in confluence-users were inactive so my final list included some inactive users. But inactive users have no business being in groups – they should be removed!

Once I removed them, the list of confluence-users IS the list of active users.

In summary: to get a list of users you need a group or a collection of groups that have all the users in it. Then you need to make sure that these groups have no inactive users. Then you can uses the <url>/rest/api/group<group name>/member API to get the users from those groups (be sure to remove any duplicates from the aggregated  list) and it will be correct!

Puja Nayak (IN) July 9, 2018

<url>/rest/api/group<group name>/member API is not retrieving more than 200 members in a group.Is there a way to get rid of the system default limit 200?

Saquib Fraz
Contributor
December 30, 2019

yeah it's not listing above 200. please help me to get out of this

1 vote
Timothy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 27, 2016

If you've already search and found no REST api to do it, you'll probably have to write your own REST api to expose that data.

 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events