Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,298,228
Community Members
 
Community Events
165
Community Groups

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

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

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

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
Community showcase
Published in Atlassian Access

Atlassian Access Demo Q&A Recap

Hi Community! Thank you to all who joined our ongoing monthly Atlassian Access demo! We have an engaging group of attendees who asked many great questions. I’ll share a recap of frequently ask...

1,152 views 4 4
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you