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

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

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

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 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/

@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 May 30, 2018

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

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?

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.

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

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

Tarun Sapra Community Leader 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 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
Community showcase
Published in Apps & Integrations

🍻🍂Apptoberfest Update: Upcoming Virtual Events 🎉

Hello Community! I hope you've been enjoying the 🍂Apptoberfestivities🍂 (I know I have!) The event is heating up next week with a series of virtual events that we're calling the 🍻🍂Partner App ...

97 views 1 6
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