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 @Tran Tien Dung

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.

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"

Yes thanks for the point

@Tran Tien DungPlease see link posted by  @Tarun Sapra

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 

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Opsgenie

DevOps Just Got a Whole Lot Easier with Opsgenie and AWS CloudFormation Registry and CLI

...esponders": [{ "type": "team", "name": { "Fn::GetAtt": [ "NemoSearchParty", "Name" ] } }], "Enabled": true }, "DependsOn": [ "TeamA" ] }, "C...

984 views 0 10
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