Div | ||
---|---|---|
| ||
Intake Service Home | ||
Brief Description
Wiki Markup |
---|
{multi-excerpt-include:Intake Service Description and Assumptions|name=brief-description|nopanel=true} |
Assumptions
Wiki Markup |
---|
{multi-excerpt-include:Intake Service Description and Assumptions|name=brief-assumptions|nopanel=true} |
References
Object Entry Requirements
Intake Service Description and Assumptions
Intake Service Entity Diagrams
REST-based API
The Intake Service offers a REST-based Application Programming Interface (API) to CRUD (create, read, update, and delete) operations on individual Intakes.
...
Send this HTTP request:
Code Block |
---|
GET /cspace-services/intakes/ HTTP/1.1
|
To do this via a web browser:
Code Block |
---|
To do this via the 'curl' command-line utility:
Code Block |
---|
curl http://demo.collectionspace.org:8180/cspace-services/intakes/
|
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 Intake records, if any, is returned:
Code Block |
---|
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: nnnn
...
|
Code Block | ||||||
---|---|---|---|---|---|---|
|
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ns2:intake-list>
<intake-list-item>
<uri>/default/abf52fbc-0471-4f3b-b1b1-c186bb79c44d</uri>
<csid>abf52fbc-0471-4f3b-b1b1-c186bb79c44d</csid>
</intake-list-item>
<intake-list-item>
<uri>/default/9eb9f43e-95fe-417b-aefc-a44d0f38d3cb</uri>
<csid>9eb9f43e-95fe-417b-aefc-a44d0f38d3cb</csid>
</intake-list-item>
<intake-list-item>
<uri>/default/78981343-12bb-4a55-ace7-fad6dd8280e0</uri>
<csid>78981343-12bb-4a55-ace7-fad6dd8280e0</csid>
</intake-list-item>
<intake-list-item>
<uri>/default/a368c2df-b7c5-47db-99ce-88f1367b7d33</uri>
<csid>a368c2df-b7c5-47db-99ce-88f1367b7d33</csid>
</intake-list-item>
</ns2:intake-list>
||||||
If no Intake records are found, a response with a "200 OK" HTTP status code, followed by an empty list, is returned:
Code Block |
---|
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: nnnn
...
|
Code Block | ||||||
---|---|---|---|---|---|---|
|
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ns2:intake-list xmlns:ns2="http://services.collectionspace.org/intake"/>
||||||
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.
...
Send this HTTP request:
Code Block |
---|
with an entity body containing a valid XML representation of a Intake; e.g.:
Code Block |
---|
To do this via the 'curl' command-line utility:
Code Block |
---|
(The "-T -" parameter above specifies that the body of the request will come from standard input.)
Or, alternately:
Code Block |
---|
(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 Intake record is to be added; e.g. end your URL with "intakes', not "intakes/". 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.)
...
On success, a response with a "201 Created" HTTP status code is returned:
Code Block |
---|
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.
...
Send this HTTP request:
Code Block |
---|
GET /cspace-services/intakes/{id} HTTP/1.1
|
To do this via a web browser:
Code Block |
---|
http://demo.collectionspace.org:8180/cspace-services/intakes/{id} |
To do this via the 'curl' command-line utility:
Code Block |
---|
curl http://demo.collectionspace.org:8180/cspace-services/intakes/{id}
|
Where {id} is a CollectionSpace ID (csid), such as 59242af0-0463-4fb2-af0d-2467186c28480. To identify the ID of a specific document, List All Intakes or check the response from a request to Create a Intake.
...
On success, a response with a "200 OK" HTTP status code and a representation of the requested Intake record is returned:
Code Block |
---|
Code Block | ||||||
---|---|---|---|---|---|---|
|
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ns2:intake xmlns:ns2="http://services.collectionspace.org/intake">
<currentOwner>Ron McDonald</currentOwner>
<depositor>Peter Wolf</depositor>
<depositorsRequirements>Reserve ownership.</depositorsRequirements>
<entryDate>12-02-2009</entryDate>
<entryMethod>Manual</entryMethod>
<entryNote>Needs restoration</entryNote>
<entryNumber>1246391492901</entryNumber>
<entryReason>None given</entryReason>
<packingNote>None</packingNote>
<returnDate>12-30-2009</returnDate>
</ns2:intake>
||||||
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.
...
Send this HTTP request:
Code Block |
---|
with an entity body containing a valid XML representation of a Intake; e.g.:
Code Block |
---|
To do this via the 'curl' command-line utility:
Code Block |
---|
curl -X PUT -H "Content-Type: application/xml" \
http://demo.collectionspace.org:8180/cspace-services/intakes/{id} -T - < {data}
|
(The "-T -" parameter above specifies that the body of the request will come from standard input.)
Or, alternately:
Code Block |
---|
Where {id} is a CollectionSpace ID (csid), such as 59242af0-0463-4fb2-af0d-2467186c28480. To identify the ID of a specific document, List All Intakes or check the response from a request to Create a Intake.
...
On success, a response with a "200 OK" HTTP status code and a representation of the updated Intake record is returned:
Code Block |
---|
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: nnnn
...
|
Code Block |
---|
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<ns2:intake xmlns:ns2="http://services.collectionspace.org/intake">
<currentOwner>Ron McDonald</currentOwner>
<depositor>Peter Wolf</depositor>
<depositorsRequirements>Reserve ownership.</depositorsRequirements>
<entryDate>12-02-2009</entryDate>
<entryMethod>Manual</entryMethod>
<entryNote>Needs restoration</entryNote>
<entryNumber>1246391492901</entryNumber>
<entryReason>None given</entryReason>
<packingNote>None</packingNote>
<returnDate>12-30-2009</returnDate>
</ns2:intake>
|
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.
...
Send this HTTP request:
Code Block |
---|
DELETE /cspace-services/intakes/{id} HTTP/1.1
|
To do this via the 'curl' command-line utility:
Code Block |
---|
Where {id} is a CollectionSpace ID (csid), such as 59242af0-0463-4fb2-af0d-2467186c28480. To identify the ID of a specific document, List All Intakes or check the response from a request to Create a Intake.
...
On success, a response with a "200 OK" HTTP status code is returned:
Code Block |
---|
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.
...