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

How to list groups and their members in specific directory via RestAPI?

tiendungitd
Contributor
May 30, 2018

Hi everyone,

How do I get a list of all group and their members in specific directory in crowd? I just want to see a display name of user/group. Also a user status, I want to get only users are activating.

For example

  • Group A:
    • User1
    • User2
    • ...
  • Group B

I reading Crowd REST API document, but it not mention about Crowd directory, any idea?

Thanks.

3 answers

1 accepted

1 vote
Answer accepted
Tarun Sapra
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 30, 2018

Hello @tiendungitd

The Crowd REST API is built to be accessed by Applications and thus you can fetch details of users which are part of application-directory mapping i.e. your application must be mapped to the directory whose users you want to fetch. You can also create a dummy application for this purpose.

From the docs

This set of REST APIs is intended to be used by applications connecting to Crowd.

https://docs.atlassian.com/atlassian-crowd/3.1.3/REST/

tiendungitd
Contributor
May 30, 2018

@Tarun Sapra

I'm using the command below to fetch user membership

curl -u user:pass http://localhost:8095/crowd/rest/usermanagement/latest/group/membership

But it get all users/groups in all Crowd Directories, my expect is only get from one Directory. 

Regards

Dung

Tarun Sapra
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 30, 2018

That's happening because the username:password you are using belong to an application that is mapped to all directories.

tiendungitd
Contributor
May 30, 2018

Thanks Tarun, now I got your idea. I just added new Generic Application with application url is a current crowd url, now I can get user information in Directory which mapping to the new Application.

Do you know how to list all group?

Tarun Sapra
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 30, 2018

Yes, it's easy

please go through the docs here

Get all membershipsGET /rest/usermanagement/1/group/membership

Retrieves full details of all group memberships, with users and nested groups. This resource is optimised for streaming XML responses, and does not support JSON responses.

Tarun Sapra
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 30, 2018
0 votes
manish March 15, 2019

above given command does work me after i did some changes.

manish March 15, 2019

i need to crowd api to create groups for new user for a new onboarding project 

0 votes
Moses Thomas
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 30, 2018
Tarun Sapra
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 30, 2018

Hello @Moses Thomas

I think you have mis-read the question as it's about "Crowd Rest API" but the link shared by you is for the "Cloud API"

Moses Thomas
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 30, 2018

Yes thanks for the point

@tiendungitdPlease see link posted by  @Tarun Sapra

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events