Missed Team ’24? Catch up on announcements here.

×
Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

REST API to Search users in Confluence with all data of User Account

Mrinalini Pal August 18, 2021

I have created a few user accounts in a directory having details like first name, last name, username and primary email ID using the User Provisioning POST API and added some of them to confluence-users group to provide Confluence access using Add Member to Group API.

I want to do a search operation for all users that are present in the confluence-users group (that is, all active users having Confluence access) along with details of the user as returned by the User Provisioning GET API. The search API should be able to search based on filters and also support pagination.

Please help with suggestions!

1 answer

0 votes
JimmyVanAU
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.
August 18, 2021

Hi Mrinalini,

I'd start by looking at the Access SCIM APIs, followed by looking at the Confluence API itself.

Firstly, grab the group ID (GET /scim/directory/{directoryId}/Groups).

You can then feed this into the get groups endpoint (GET /scim/directory/{directoryId}/Groups/{id}) which will return a list of SCIM users.

If this is too broad (noting it doesn't provide the search you requested), then have a look at the Confluence REST API https://developer.atlassian.com/cloud/confluence/rest/

The endpoints of interest are:

Get group members (GET /wiki/rest/api/group/member)
and
Search groups by partial query (GET /wiki/rest/api/group/picker)

The last endpoint allows you to search based on filter and supports pagination.

Hope that helps!
Jimmy

Mrinalini Pal August 18, 2021

Hi Jimmy,

I think you did not understand my question properly. I want to do a search on the users that are a member of confluence-users group.

I have found out a way to do it but it does not support pagination of the final result set. First I fetch all users that are a part of the directory using Get Users API. I can fetch the users that have Confluence access by using Get Group Members API where the group name is confluence-users.

If the user from confluence-users list is present in the list of users in the directory (matched by accountId attribute) then I add those users to make my final list of users that are present in the directory and are a part of confluence-users group(that is, have Confluence access). The Get Users API supports filters but how to paginate my final list I create?

Is there a simpler way out?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events