Crowd 2.0 : Using the REST APIs
This page last changed on Jul 13, 2009 by smaddox.
This page contains information on the factors common across all or most of the Crowd REST APIs, and an example of how to use the REST APIs to perform a simple task. Another page contains the details of the specific REST resources.
On this page: REST Resources and URI 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 Here is an explanation for each part of the URI:
Refer to the details of the specific REST resources. Media TypesThe Crowd REST APIs return HTTP responses in one of the following formats:
API VersionsThe Crowd REST APIs are subject to version control. The version number of an API appears in its URI. For example, use this URI structure to request version 1 of the 'admin' API: http://host:port/context/rest/admin/1/... To get the latest version of the API, you can also use the latest key-word. For example, if versions 1 and 2 of the 'admin' API are available, the following two URIs will point to the same resources:
Notes:
AuthenticationAccess to all resources (using any method) requires the client to be authenticated, via basic authentication. See RFC 2617. For example, the following cURL request searches for a user called 'smith', with basic authentication where the username and password are both 'admin': curl http://localhost:8095/crowd/rest/admin/latest/directory/atlassian%20crowd/user?search=smith -u admin:admin
HTTP Response CodesAn error condition will return an HTTP error code as described in the Atlassian REST Guidelines. MethodsYou will use the standard HTTP methods to access Crowd via the REST APIs. Please refer to the resource descriptions to see the HTTP methods available for each resource. Example of Using the CROWD APIsBelow is a start-to-finish description of how to use the Crowd REST APIs to perform a simple task.
RELATED TOPICS |
![]() |
Document generated by Confluence on Jul 30, 2009 01:30 |