Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 9 Next »

Brief Description

For a full description, visit the Service Description and Assumptions page.

Assumptions

For a complete list of assumptions, visit the Service Description and Assumptions page.

REST-based API

The Loan Out Service offers a REST-based Application Programming Interface (API) to CRUD (create, read, update, and delete) operations on individual Loan Out instances, plus list operations on multiple Loan Out instances. These follow the Common model for CollectionSpace REST services.

Loan Out CRUD+L services

Create an Loan Out

Creates a new Loan Out record. Assigns a unique, service-specified CollectionSpace ID (CSID) to that Loan Out record. Follows standard Create model. See the documentation of the Loan Out schema, below. Example:

POST /cspace-services/loansout HTTP/1.1
Read an Loan Out

Reads an existing Loan Out record, specified by its CollectionSpace ID (CSID). Follows standard Read model. See the documentation of the Loan Out schema, below. Example:

GET /cspace-services/loansout/{id} HTTP/1.1
Update an Loan Out

Updates an existing Loan Out record, specified by its CollectionSpace ID (CSID). Follows standard Update model. See the documentation of the Loan Out schema, below. Example:

PUT /cspace-services/loansout/{id} HTTP/1.1
Delete an Loan Out

Deletes an existing Loan Out record, specified by its CollectionSpace ID (CSID). Follows standard Delete model. Example:

DELETE /cspace-services/loansout/{id} HTTP/1.1
List Loan Out instances

Lists existing Loan Out records, with summary information for each. Follows standard List model. See the documentation of the Loan Out list schema, below. Example:

GET /cspace-services/loansout HTTP/1.1

List supports query parameters for customizing list results, such as pagination controls, query filters, and sorting options. For example:

GET /cspace-services/loansout?pgSz=10 HTTP/1.1

List also supports query parameters for searching for matching records, including keyword search. For example:

GET /cspace-services/loansout?kw=foo&pgSz=10 HTTP/1.1

Loan Out REST payload schemas

Loan Out instance schema

The schemas below are severely abbreviated, and are thus illustrative. For a full list of the fields that may potentially be present in payloads when creating, updating, or reading individual Loan Out records, please see the Loan Out record schema for release 0.5.2.

Create and Update should use the following schema:

<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<ns2:loansout_common xmlns:ns2="http://collectionspace.org/services/loanout">
    <loanOutNumber>LO2010.117</loanOutNumber>
    <borrower>urn:cspace:org.collectionspace.demo:orgauthority:name(TestOrgAuth):organization:name(Northern Climes Museum)'Northern Climes Museum'")</borrower>
    <borrowersContact>urn:cspace:org.collectionspace.demo:personauthority:name(TestPersonAuth):person:name(Chris Contact)'Chris Contact'</borrowersContact>
    <loanReturnDate>2012-01-29</loanReturnDate>
    <loanPurpose>Allow people in cold climes to share the magic of Surfboards of the 1960s, via planned exhibition beginning 2 March 2011.</loanPurpose>
    ...
</ns2:loansout_common>

Read will return the following schema:

<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<ns2:loansout_common xmlns:ns2="http://collectionspace.org/services/loanout" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://collectionspace.org/services/loanout http://services.collectionspace.org/loanout/loansout_common.xsd">
    <loanOutNumber>LO2010.117</loanOutNumber>
    <borrower>urn:cspace:org.collectionspace.demo:orgauthority:name(TestOrgAuth):organization:name(Northern Climes Museum)'Northern Climes Museum'")</borrower>
    <borrowersContact>urn:cspace:org.collectionspace.demo:personauthority:name(TestPersonAuth):person:name(Chris Contact)'Chris Contact'</borrowersContact>
    <loanReturnDate>2012-01-29</loanReturnDate>
    <loanPurpose>Allow people in cold climes to share the magic of Surfboards of the 1960s, via planned exhibition beginning 2 March 2011.</loanPurpose>
    ...
</ns2:loansout_common>
Loan Out list schema

List (and variants) will return the following schema. This schema includes the uri and csid fields to help facilitate access to individual records:

<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<ns2:loansout-common-list xmlns:ns2="http://collectionspace.org/services/loanout">
  <loanout-list-item>
    <loanOutNumber>LO2010.117</loanOutNumber>
    <loanReturnDate>2012-01-29</loanReturnDate>
    <uri>/loansout/b59d0c6f-08f2-4fb5-b5f7</uri>
    <csid>b59d0c6f-08f2-4fb5-b5f7</csid>
  </loanout-list-item>
  ....
</ns2:loansout-common-list>
  • No labels