I can create a new group via REST API but can't find any API to enable/associate the newly created group with the application Directory. Currently, this has to be done via the Admin console GUI.
Has anyone found the right API for this?
Thanks
see the reply section :-)
Hello Allan,
Please see my answer here (this is a duplicate question as far as I understand it): https://community.atlassian.com/t5/Crowd-questions/Atlassian-CROWD-REST-API-for-quot-Associating-linking-a-Group-to/qaq-p/582495
Thanks Bruno,
It does the trick :-)
Another question, I can't remove a user from a group, it gave me error.
HTTP/1.1 500 Internal Server ErrorServer: Apache-Coyote/1.1X-Embedded-Crowd-Version: Crowd/2.11.0X-Crowd-User-Management-Version: 1.4X-ASEN: SEN-L9527447Set-Cookie: JSESSIONID=7ED6DFD32CFE6B3A68A178A3213EE782; Path=/crowd/; HttpOnlyX-Content-Type-Options: nosniffVary: Accept,Accept-EncodingContent-Type: application/jsonTransfer-Encoding: chunkedDate: Fri, 02 Jun 2017 17:26:12 GMTConnection: close
{"message":"The validated object is null","status-code":500,"stack-trace":"java.lang.NullPointerException: The validated object is null\tat org.apache.commons.lang3.Validate.notNull(Validate.java:222)\tat org.apache.commons.lang3.Validate.notNull(Validate.java:203)\tat com.atlassian.crowd.manager.application.AliasManagerImpl.findUsernameByAlias(AliasManagerImpl.java:41)\tat sun.reflect.GeneratedMethodAccessor348.invoke(Unknown Source)\tat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\tat
...
Here is the RestApi snippet
curl -X DELETE -ik -u $app:$passwd -H "Content-Type: application/json" -H "Accept: application/json" https://$crowdServer/crowd/rest/usermanagement/1/group/user/direct?groupname=$name&username=$user
Appreciate your input on this.
Thanks,
Allan
The resource URI should be
/rest/usermanagement/1/user/group/direct
instead of
/rest/usermanagement/1/group/user/direct
;-)
https://docs.atlassian.com/atlassian-crowd/latest/REST/#usermanagement/1/user-removeUserFromGroup
Thanks for quick response, still no luck, something weird with the error message it said groupName can't be empty.
HTTP/1.1 500 Internal Server ErrorServer: Apache-Coyote/1.1X-Embedded-Crowd-Version: Crowd/2.11.0X-Crowd-User-Management-Version: 1.4X-ASEN: SEN-L9527447Set-Cookie: JSESSIONID=AA14A44B09E04478E90B78DD6D12E5C0; Path=/crowd/; HttpOnlyX-Content-Type-Options: nosniffVary: Accept,Accept-EncodingContent-Type: application/jsonTransfer-Encoding: chunkedDate: Fri, 02 Jun 2017 18:33:49 GMTConnection: close
{"message":"groupName cannot be null or empty","status-code":500,"stack-trace":"java.lang.NullPointerException: groupName cannot be null or empty\tat org.apache.commons.lang3.Validate.notEmpty(Validate.java:395)\tat
Here is the harcoded groupname and username:
curl -X DELETE -ik -u $app:$passwd -H "Content-Type: application/json" -H "Accept: application/json" https://$crowdServer/crowd/rest/usermanagement/1/user/group/direct?username=dude123&groupname=qa_leads
It looks like you're new here. Sign in or register to get started.