REST (or alternative) call for user details from confluence

322 views
Skip to first unread message

Ajay Upadhyaya

unread,
Sep 29, 2015, 8:34:44 PM9/29/15
to Atlassian Connect Dev
Hi,

I'm developing a confluence connect add-on, that would have jwt based authentication. The add on will have a user sync option to sync users from confluence into the add-on application's database for provisioning. I need to get list of users with username, email, display name and their groups details.

So far here is what I could gather

Get the user list using - /confluence/rest/user-management/1.0/users

For each user e.g. jdoe in above output, call - /confluence/rest/prototype/1/user/non-system/jdoe

This gives me the email and displayname, but not the groups where user is member of.

Also I could find list of groups by this call
/confluence/rest/user-management/1.0/groups
but couldn't find how to get list of users in the groups returned from above call.

Any pointers would be greatly appreciated.

Best,
Ajay

James Hazelwood

unread,
Sep 30, 2015, 3:14:51 AM9/30/15
to Atlassian Connect Dev
Hi Ajay,

rest/user-management is not part of the allowed add-on REST scopes, so an add-on will not be able to call it.

Additions to the Confluence REST API are in the works, including user operations. You can follow this issue to be notified of updates.

In the meanwhile, a combination of REST and json rpc should do the trick (note that these are deprecated and so you should switch to the new API methods when they become available):

To get a list of all active users (requires ADMIN scope for your add-on)
POST <base url>/rpc/json-rpc/confluenceservice-v2/getActiveUsers
with the following body (Content-Type application/json):
[true]

To get details for a specific user:
GET <base url>/rest/prototype/1/user/non-system/{username}

To get group memberships for a specific user:
POST <base url>/rpc/json-rpc/confluenceservice-v2/getUserGroups
with the following body (Content-Type application/json):
["{username}"]

Ajay Upadhyaya

unread,
Sep 30, 2015, 3:00:11 PM9/30/15
to Atlassian Connect Dev
Thanks for the reply. I'll keep an eye on the JIRA issue for new APIs.
Reply all
Reply to author
Forward
0 new messages