Citation Service REST APIs

Brief Description

Unknown macro: {multi-excerpt-include}
For a full description, visit the Service Description and Assumptions page.

Assumptions

Unknown macro: {multi-excerpt-include}
For a complete list of assumptions, visit the Service Description and Assumptions page.

References

Vocabulary and Authority Overview
Citation Service Description and Assumptions
Citation Service Entity Diagrams
CitationAuthority Schema, CitationAuthority Schema and Mockup - UCB Version

REST-based API

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

Note that the Citation instances are not directly "addressable"; they can only be accessed via the parent CitationAuthority.

CitationAuthority CRUD+L services

Create a CitationAuthority

Creates a new CitationAuthority record.  Assigns a unique, service-specified /wiki/spaces/collectionspace/pages/666274321 to that CitationAuthority record. Follows standard Create model. See the documentation of the CitationAuthority schema, below. Example:

 
Read a CitationAuthority

Reads an existing CitationAuthority record, specified by its /wiki/spaces/collectionspace/pages/666274321. Follows standard Read model. See the documentation of the CitationAuthority schema, below. Example:

 
Update a CitationAuthority

Updates an existing CitationAuthority record, specified by its /wiki/spaces/collectionspace/pages/666274321. Follows standard Update model. See the documentation of the CitationAuthority schema, below. Example:

 
Delete a CitationAuthority

Deletes an existing CitationAuthority record, specified by its /wiki/spaces/collectionspace/pages/666274321. Follows standard Delete model. Example:

 
List CitationAuthority instances

Lists existing CitationAuthority records, with summary information for each. Follows standard List model, with pagination support. See the documentation of the CitationAuthority-List schema, below. List supports the following common parameters for List results, pagination controls and query filters:

  • pgSz for page size
  • pgNum for page number

Examples:

 

CitationAuthority REST payload schemas

The schemas below are 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 CitationAuthority records, please see the most recent CitationAuthority schema.

CitationAuthority instance schema

Create and Update should use the following schema.

 

Read will return the above, plus additional fields (uri and csid) for access:

 
CitationAuthority-List schema

List (and variants) will return the following schema:

 

Citation CRUD+L services

Citation instances are only accessible via the owning CitationAuthority. The sub-resource is accessed with "items" (for consistency across all vocabulary-like services). In the examples below, the {citation_auth_id} parameter represents the CSID value of an existing CitationAuthority instance.

Create a Citation in a CitationAuthority

Creates a new Citation record.  Assigns a unique, service-specified /wiki/spaces/collectionspace/pages/666274321 to that Citation record. Follows standard Create model. Must See the documentation of the Citation schema, below. Example:

 

You may also POST a part called

 

and any new relations there will be created. For example, this POST will add a relationship.  Note that you must know beforehand the CSIDs of related terms.  These are the CSIDs of two other Citation records, which must exist before this call.  The special variable ${itemCSID} will be expanded to the CSID of the newly created Citation. (For Java use, please use the constant in CommonAPI.AuthorityItemCSID_REPLACE )

 

NOTE: if you wish to delete related items, simply send relations-common-list as an empty element. This is shown in a comment here:
http://wiki.collectionspace.org/display/collectionspace/Person+Service+REST+APIs?focusedCommentId=72220749&#comment-72220749

Read a Citation in a CitationAuthority

Reads an existing Citation record, specified by its /wiki/spaces/collectionspace/pages/666274321. Follows standard Read model. See the documentation of the Citation schema, below. Example:

 

There are additional query parameters to get the relations for this item.
Query Parameters are defined and explained here, with examples: Authority REST API for Hierarchies

Update a Citation in a CitationAuthority

Updates an existing Citation record, specified by its /wiki/spaces/collectionspace/pages/666274321. Follows standard Update model. See the documentation of the Citation schema, below. Example:

 

You may also PUT a part called

 

and any new relations there will be created.  Relations to the updated item which are missing from the relations list in the PUT will be deleted from persistence.  No target records are deleted, just the relations records that point to target records.  e.g. POST to authority with Citation "Drawing", with relations-common-list that has an entry for ${itemCSID} hasBroader "Art" creates a relations record that references both Art and Drawing.  When a PUT is made that does not have the relation for Art, then Drawing has no relations, so the relations record for Drawing==>hasBroader==>Art is deleted, but both "Drawing" and "Art" Citation records remain.

Delete a Citation in a CitationAuthority

Deletes an existing Citation record, specified by its /wiki/spaces/collectionspace/pages/666274321. Follows standard Delete model. Example:

 
List Citation instances in a CitationAuthority

Lists existing Citation records, with summary information for each. Follows standard List model. See the documentation of the Citation-List schema, below. List supports the following common parameters for List results, pagination controls and query filters:

  • pgSz for page size
  • pgNum for page number
  • pt for partial-term matching, to support term completion.

Examples:

 

Citation REST payload schemas

The schemas below are 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 Citation records, please see the most recent Citation schema (i.e. for an individual Citation term within a CitationAuthority or vocabulary).

Citation instance schema

Create and Update should use the following schema.

On create, the value of inAuthority must match the identifier of the parent CitationAuthority, and will not be modified once the instance is created.

You can view the full set of validation constraints on the data you submit when creating or updating Citation instance records, in the most recent CollectionSpace code, via this Java source code file.

Here's an example payload for creating a new instance:

 

Read will return the above, plus additional fields (uri and csid) for access:

 
Citation-List schema

List (and variants) will return a schema similar to the following example: