Crowd 2.0 : REST Resources
This page last changed on Jul 29, 2009 by smaddox.
The Crowd REST APIs allow you to address the Crowd data entities as 'resources'. This means that they are identified by URIs and operated on by HTTP requests, chiefly GET and POST. Whenever you GET one of these resources, you receive a representation encoded using XML or JSON. Below are details of the resources made available by the APIs.
On this page: IntroductionURI StructureURIs for a Crowd REST API resource have the following structure: http://host:port/context/rest/api-name/api-version/resource-name Or without context: http://host:port/rest/api-name/api-version/resource-name
http://myhost.com:8095/crowd/rest/admin/1/directory http://localhost:8095/crowd/rest/admin/latest/directory Or without context: http://crowd.myhost.com:8095/rest/admin/1/directory http://crowd.myhost.com:8095/rest/admin/latest/directory More...Please refer to the Crowd REST API usage guide for a description of the common factors in the APIs, including a full explanation of the URI format, authentication, API versions, etc. Directory List
Example of a GET request: http://localhost:8095/crowd/rest/admin/latest/directory/ Example of XML response: <?xml version="1.0" encoding="UTF-8" standalone="yes" ?> <directories> <directory> <name>Active Directory</name> <type>CONNECTOR</type> <implementationClass>com.atlassian.crowd.integration.directory.connector.MicrosoftActiveDirectory</implementationClass> </directory> <directory> <name>Atlassian Crowd</name> <type>INTERNAL</type> <implementationClass>com.atlassian.crowd.integration.directory.internal.InternalDirectory</implementationClass> </directory> <directory> <name>Crowd Internal</name> <type>INTERNAL</type> <implementationClass>com.atlassian.crowd.integration.directory.internal.InternalDirectory</implementationClass> </directory> <directory> <name>Delegated Auth Directory</name> <type>DELEGATING</type> <implementationClass>com.atlassian.crowd.integration.directory.delegated.DelegatedAuthenticationDirectory</implementationClass> </directory> <directory> <name>Employees</name> <type>INTERNAL</type> <implementationClass>com.atlassian.crowd.integration.directory.internal.InternalDirectory</implementationClass> </directory> <directory> <name>My Own Connector</name> <type>CUSTOM</type> <implementationClass>com.atlassian.crowd.integration.directory.custom.MyOwnConnector</implementationClass> </directory> </directories> Elements in the response:
Example of JSON response: {"directories":[ {"name":"Active Directory", "type":"CONNECTOR", "implementationClass":"com.atlassian.crowd.integration.directory.connector.MicrosoftActiveDirectory"},{"name":"Atlassian Crowd", "type":"INTERNAL", "implementationClass":"com.atlassian.crowd.integration.directory.internal.InternalDirectory"},{"name":"Crowd Internal", "type":"INTERNAL", "implementationClass":"com.atlassian.crowd.integration.directory.internal.InternalDirectory"},{"name":"Delegated Auth Directory", "type":"DELEGATING", "implementationClass":"com.atlassian.crowd.integration.directory.delegated.DelegatedAuthenticationDirectory"},{"name":"Employees", "type":"INTERNAL", "implementationClass":"com.atlassian.crowd.integration.directory.internal.InternalDirectory"} {"name":"My Own Connector", "type":"CUSTOM", "implementationClass":"com.atlassian.crowd.integration.directory.custom.MyOwnConnector"}]} Directory Information
Example of a request for information about directory 'atlassian crowd': http://localhost:8095/crowd/rest/admin/latest/directory/atlassian%20crowd Example of XML response: <?xml version="1.0" encoding="UTF-8" standalone="yes" ?> <directory> <name>Atlassian Crowd</name> <type>INTERNAL</type> <implementationClass>com.atlassian.crowd.integration.directory.internal.InternalDirectory</implementationClass> </directory> Elements in the response:
Example of JSON response: {"name":"Atlassian Crowd", "type":"INTERNAL", "implementationClass":"com.atlassian.crowd.integration.directory.internal.InternalDirectory"} User List
Example of a search for users matching 'ad' in directory 'atlassian crowd': http://localhost:8095/crowd/rest/admin/latest/directory/atlassian%20crowd/user?search=ad Example of XML response to the above request: <?xml version="1.0" encoding="UTF-8" standalone="yes" ?> <users> <user> <identifier>adent</identifier> <username>adent</username> <firstName>Arthur</firstName> <lastName>Dent</lastName> <displayName>Arthur Dent</displayName> <emailAddress>adent@example.com</emailAddress> </user> <user> <identifier>admin</identifier> <username>admin</username> <firstName>Admin</firstName> <lastName>Administrator</lastName> <displayName>Admin Administrator</displayName> <emailAddress>admin@example.com</emailAddress> </user> </users> Elements in the response:
Example of JSON response for a list of users: {"users":[ {"identifier":"adent", "username":"adent", "firstName":"Arthur", "lastName":"Dent", "displayName":"Arthur Dent", "emailAddress":"adent@example.com"}, {"identifier":"admin", "username":"admin", "firstName":"Admin", "lastName":"Administrator", "displayName":"Admin Administrator", "emailAddress":"admin@example.com"}]} User Information
Here is an example of a request for information on user 'adent' in directory 'atlassian crowd': http://localhost:8095/crowd/rest/admin/latest/directory/atlassian%20crowd/user/adent The following cURL request deletes the user 'adent', using basic authentication where the username and password are both 'admin':
curl -X DELETE http://localhost:8095/crowd/rest/admin/latest/directory/atlassian%20crowd/user/adent -u admin:admin
Example of XML response giving user information: <?xml version="1.0" encoding="UTF-8" standalone="yes" ?> <user> <identifier>adent</identifier> <username>adent</username> <firstName>Arthur</firstName> <lastName>Dent</lastName> <displayName>Arthur Dent</displayName> <emailAddress>adent@example.com</emailAddress> </user> Elements in the response:
Example of JSON response giving user information: {"identifier":"adent", "username":"adent", "firstName":"Arthur", "lastName":"Dent", "displayName":"Arthur Dent", "emailAddress":"adent@example.com"} Group List
Example of a search request for groups matching 'team' in directory 'atlassian crowd': http://localhost:8095/crowd/rest/admin/latest/directory/atlassian%20crowd/group?search=team Example of XML response to the above request: <?xml version="1.0" encoding="UTF-8" standalone="yes" ?> <groups> <group> <identifier>my-team</identifier> <name>my-team</name> <description>My Team</description> <type>GROUP</type> </group> <group> <identifier>team2</identifier> <name>team2</name> <description>Team 2</description> <type>GROUP</type> </group> <group> <identifier>team3</identifier> <name>team3</name> <description>Team 3</description> <type>GROUP</type> </group> <group> <identifier>teamlead</identifier> <name>teamlead</name> <description>Team Leader</description> <type>LEGACY_ROLE</type> </group> </groups> Elements in the response:
Example of JSON response for a list of groups: {"groups":[ {"identifier":"my-team", "name":"my-team", "description":"My Team", "type":"GROUP"}, {"identifier":"team2", "name":"team2", "description":"Team 2", "type":"GROUP"}, {"identifier":"team3", "name":"team3", "description":"Team 3", "type":"GROUP"}, {"identifier":"teamlead", "name":"teamlead", "description":"Team Leader" "type":"LEGACY_ROLE"}]} Group Information
Here is an example of a request for information on group 'my-team' in directory 'atlassian crowd': http://localhost:8095/crowd/rest/admin/latest/directory/atlassian%20crowd/group/my-team The following cURL request deletes the group 'my-team', using basic authentication where the username and password are both 'admin':
curl -X DELETE http://localhost:8095/crowd/rest/admin/latest/directory/atlassian%20crowd/group/my-team -u admin:admin
Example of XML response for group information: <?xml version="1.0" encoding="UTF-8" standalone="yes" ?> <group> <identifier>my-team</identifier> <name>my-team</name> <description>My Team</description> <type>GROUP</type> </group> Elements in the response:
Example of JSON response for group information: {"identifier":"my-team", "name":"my-team", "description":"My Team", "type":"GROUP"} Group Membership for a User
Here is an example of a request for the groups to which user 'adent' belongs, in directory 'atlassian crowd': http://localhost:8095/crowd/rest/admin/latest/directory/atlassian%20crowd/user/adent/memberships Example of XML response for a list of group memberships: <?xml version="1.0" encoding="UTF-8" standalone="yes" ?> <groups> <group> <identifier>my-team</identifier> <name>my-team</name> <description>My Team</description> <type>GROUP</type> </group> <group> <identifier>techwriter</identifier> <name>techwriter</name> <description>Technical writer</description> <type>LEGACY_ROLE</type> </group> <group> <identifier>confluence-users</identifier> <name>confluence-users</name> <description>Confluence users</description> <type>GROUP</type> </group> </groups> Elements in the response:
Example of JSON response for a list of group members: {"group": [{"identifier":"my-team", "name":"my-team", "description":"My Team", "type":"GROUP"}, {"identifier":"techwriter", "name":"techwriter", "description":"Technical writer", "type":"LEGACY_ROLE"}, {"identifier":"confluence-users", "name":"confluence-users", "description":"Confluence users", "type":"GROUP"}]} RELATED TOPICS |
![]() |
Document generated by Confluence on Jul 30, 2009 01:30 |