This page is obsolete as of the v0.3 release of CollectionSpace.
| This is a frozen-in-time description of REST APIs for Release v0.1, aka "Hello World".
To keep up with the evolution of REST APIs for accessing CollectionSpace services, as the project progresses past this release, please see REST-based APIs - A Template for Services. |
Brief Description
The CollectionObject service's primary operations support the creation and management of the information related to the collection objects in a museum, archive, or other collection repository. This service can be used to create, retrieve, update, and delete information about collection objects.For a full desciption, visit the Service Description and Assumptions page.
Assumptions
A brief summary of assumptions goes hereFor a complete list of assumptions, visit the Service Description and Assumptions page.
References
Object Entry Requirements
CollectionObject Service Description and Assumptions
CollectionObject Service Entity Diagrams
REST-based API
The CollectionObject Service offers a REST-based Application Programming Interface (API) to CRUD (create, read, update, and delete) operations on individual CollectionObjects.
In this API, there is also an operation to retrieve a list with summary information about all collection objects. The IDs returned in that list can be used in the aforementioned CRUD operations.
- List All CollectionObjects
- Create a CollectionObject
- Read a CollectionObject
- Update a CollectionObject
- Delete a CollectionObject
List All CollectionObjects
Description
Gets summary information about all collection objects. This includes the CollectionSpace ID (cid) of each object, which can be included in the URIs of subsequent requests in order to read, update, or delete specific objects.
Authentication
In Release 0.1, no authentication credentials are requested by the service.
The service currently performs its own internal authentication, using HTTP Basic authentication, to Nuxeo's REST-based API. This will change in subsequent service releases.
Arguments
This service call currently does not accept query parameters or other arguments.
Example: Request
Send this HTTP request:
To do this via a web browser:
To do this via the 'curl' command-line utility:
Example: Success response
On success, a response with a "200 OK" HTTP status code, followed by a list containing summary information for each of the existing collection objects, if any, is returned:
If no collection objects are found, a response with a "200 OK" HTTP status code, followed by an empty list, is returned:
Error Codes
To determine if an error occurred, check the HTTP Status Code that is returned in the response's HTTP headers. Any non 2xx status code represents an error condition.
Nearly every HTTP client library or framework will offer a call that allows you to easily examine the status code of the response. In 'curl', you can dump to a file the HTTP headers that you receive in a response, by adding the '-D {filename}' parameter to your request.
Create a CollectionObject
Description
Creates a new collection object. Assigns a unique, service-specified CollectionSpace ID (csid) to that object.
Authentication
In Release 0.1, no authentication credentials are requested by the service.
The service currently performs its own internal authentication, using HTTP Basic authentication, to Nuxeo's REST-based API. This will change in subsequent service releases.
Arguments
This service call currently does not accept query parameters or other arguments.
Example: Request
Send this HTTP request:
with an entity body containing a valid XML representation of a CollectionObject; e.g.:
To do this via the 'curl' command-line utility:
(The "-T -" parameter above specifies that the body of the request will come from standard input.)
Or, alternately:
(Note that in this alternate request using 'curl', there should not be a closing slash at the end of the name of the container to which the new collection object is to be added; e.g. end your URL with "collectionobjects', not "collectionobjects/". That is because at least some versions of curl appear to append the name of the file being uploaded to the URL, following a closing slash.)
Where {data} or {filename or path to file containing data} is a valid XML representation of a CollectionObject, provided via standard input or stored in a text file, respectively.
In both instances, the "-H "Content-Type: application/xml" is required; this adds a "Content-Type: application/xml" header line to the request headers.
Example: Success response
On success, a response with a "201 Created" HTTP status code is returned:
Error Codes
To determine if an error occurred, check the HTTP Status Code that is returned in the response's HTTP headers. Any non 2xx status code represents an error condition.
Nearly every HTTP client library or framework will offer a call that allows you to easily examine the status code of the response. In 'curl', you can dump to a file the HTTP headers that you receive in a response, by adding the '-D {filename}' parameter to your request.
Read a CollectionObject
Description
Gets (reads) information about a single collection object, specified by its CollectionSpace ID (csid).
Authentication
In Release 0.1, no authentication credentials are requested by the service.
The service currently performs its own internal authentication, using HTTP Basic authentication, to Nuxeo's REST-based API. This will change in subsequent service releases.
Arguments
This service call currently does not accept query parameters or other arguments.
Example: Request
Send this HTTP request:
To do this via a web browser:
To do this via the 'curl' command-line utility:
Where {id} is a CollectionSpace ID (csid), such as 59242af0-0463-4fb2-af0d-2467186c28480. To identify the ID of a specific document, List All CollectionObjects or check the response from a request to Create a CollectionObject.
Example: Success response
On success, a response with a "200 OK" HTTP status code and a representation of the requested collection object is returned:
Error Codes
To determine if an error occurred, check the HTTP Status Code that is returned in the response's HTTP headers. Any non 2xx status code represents an error condition.
Nearly every HTTP client library or framework will offer a call that allows you to easily examine the status code of the response. In 'curl', you can dump to a file the HTTP headers that you receive in a response, by adding the '-D {filename}' parameter to your request.
| As of 2009-04-14 19:42-700, this call, when used with a non-existent csid, currently returns an empty collection object element with no child elements and a 200 OK status code, rather than a 404 Not Found status code. |
Update a CollectionObject
Description
Updates an individual collection object, specified by its CollectionSpace ID (csid). Accepts a updated collection object in the body of the request. Replaces the values of the existing collection object's fields (elements) with any non-empty values provided in the updated collection object. Empty fields in the updated collection object are ignored.
Subsequent releases may provide more intelligent merging during updates, and/or more client control over how merges are performed.
Authentication
In Release 0.1, no authentication credentials are requested by the service.
The service currently performs its own internal authentication, using HTTP Basic authentication, to Nuxeo's REST-based API. This will change in subsequent service releases.
Arguments
This service call currently does not accept query parameters or other arguments.
Example: Request
Send this HTTP request:
with an entity body containing a valid XML representation of a CollectionObject; e.g.:
To do this via the 'curl' command-line utility:
(The "-T -" parameter above specifies that the body of the request will come from standard input.)
Or, alternately:
Where {id} is a CollectionSpace ID (csid), such as 59242af0-0463-4fb2-af0d-2467186c28480. To identify the ID of a specific document, List All CollectionObjects or check the response from a request to Create a CollectionObject.
Where {data} or {filename or path to file containing data} is a valid XML representation of a CollectionObject, provided via standard input or stored in a text file, respectively.
In both instances, the "-H "Content-Type: application/xml" is required; this adds a "Content-Type: application/xml" header line to the request headers.
Example: Success response
On success, a response with a "200 OK" HTTP status code and a representation of the updated collection object is returned:
Error Codes
To determine if an error occurred, check the HTTP Status Code that is returned in the response's HTTP headers. Any non 2xx status code represents an error condition.
Nearly every HTTP client library or framework will offer a call that allows you to easily examine the status code of the response. In 'curl', you can dump to a file the HTTP headers that you receive in a response, by adding the '-D {filename}' parameter to your request.
| As of 2009-04-15 19:30-700, this call, when used with a csid that does not match that of any existing object, returns a 200 OK status code. We'll need to verify whether this is desired behavior; it may be the case that a PUT to a non-existent csid does not actually create a new document, using Nuxeo's Restlet-based API. |
Delete a CollectionObject
Description
Deletes a single collection object, specified by its CollectionSpace ID (csid).
Authentication
In Release 0.1, no authentication credentials are requested by the service.
The service currently performs its own internal authentication, using HTTP Basic authentication, to Nuxeo's REST-based API. This will change in subsequent service releases.
Arguments
This service call currently does not accept query parameters or other arguments.
Example: Request
Send this HTTP request:
To do this via the 'curl' command-line utility:
Where {id} is a CollectionSpace ID (csid), such as 59242af0-0463-4fb2-af0d-2467186c28480. To identify the ID of a specific document, List All CollectionObjects or check the response from a request to Create a CollectionObject.
Example: Success response
On success, a response with a "200 OK" HTTP status code is returned:
Error Codes
To determine if an error occurred, check the HTTP Status Code that is returned in the response's HTTP headers. Any non 2xx status code represents an error condition.
Nearly every HTTP client library or framework will offer a call that allows you to easily examine the status code of the response. In 'curl', you can dump to a file the HTTP headers that you receive in a response, by adding the '-D {filename}' parameter to your request.
| As of 2009-04-14 19:45-700, this call, when used with a non-existent csid, currently returns a 204 No Content status code, rather than a 404 Not Found status code. |