Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: put endpoints in tables for better legibility

...

Communities in DSpace are used for organization and hierarchy, and are containers that hold sub-Communities and Collections . (ex: Department of Engineering).

For an alternative way to create a Community/Collection hierarchy to the REST API take a look at Importing Community and Collection Hierarchy.


HTTP methodREST endpointDescription
GET/communities

...

Returns array of all communities

...

.
GET/communities/top-communities

...

Returns array of all top-level communities

...

.
GET/communities/{communityId}

...

Returns  community.
GET/communities/{communityId}/collections

...

Returns array of collections of a community.
GET/communities/{communityId}/communities

...

Returns array of

...

sub-communities of a community.
POST/communities

...

Create new community at top level. You must post community.
POST/communities/{communityId}/collections

...

Create new collections in community. You must post Collection.
POST/communities/{communityId}/communities

...

Create new

...

sub-community in community. You must post Community.
PUT/communities/{communityId}

...

Update community. You must put Community.
DELETE/communities/{communityId}

...

Delete community.
DELETE/communities/{communityId}/collections/{collectionId}

...

Delete collection in community.
DELETE/communities/{communityId}/communities/{communityId2}Delete sub-

...

community in community.


Collections

Collections in DSpace are containers of Items. (ex: Engineering Faculty Publications).

For an alternative way to create a Community/Collection hierarchy to the REST API take a look at Importing Community and Collection Hierarchy.

HTTP methodREST endpointDescription
GET/collections

...

Return all collections

...

in array. Use the limit parameter to control items per response (default 100) and offset for paging.
GET/collections/{collectionId}

...

Return collection with id.
GET/collections/{collectionId}/items

...

Return all items of collection.
POST/collections/{collectionId}/items

...

Create posted item in collection. You must post an Item.
POST/collections/find-collection

...

Find collection by passed name.
PUT/collections/{collectionId}

...

Update collection. You must put Collection.
DELETE/collections/{collectionId}

...

Delete collection from DSpace.
DELETE/collections/{collectionId}/items/{itemId}

...

Delete item in collection.


Items

Items in DSpace represent a "work" and combine metadata and files, known as Bitstreams.

HTTP methodREST endpointDescription
GET/items

...

Return list of items.
GET/items/{item id}

...

Return item.
GET/items/{item id}/metadata

...

Return item metadata.
GET/items/{item id}/bitstreams

...

Return item bitstreams.
POST/items/find-by-metadata-field

...

Find items by metadata entry. You must post a MetadataEntry.

...

POST/items/{item id}/metadata

...

Add metadata to item. You must post an array of MetadataEntry.
POST/items/{item id}/bitstreams

...

Add bitstream to item. You must post a Bitstream.
PUT/items/{item id}/metadata

...

Update metadata in item. You must put a MetadataEntry.

...



Each

...

metadata entry that

...

will replace all prior matching metadata entries, i.e. if you submit n 'dc.subject' entries all pre-existing 'dc.subject' entries in the item will be deleted and replaced with the n entries
DELETE/items/{item id}Delete item.
DELETE/items/{item id}/metadataClear item metadata.
DELETE/items/{item id}/bitstreams/{bitstream id}Delete item bitstream.

Bitstreams

Bitstreams are files. They have a filename, size (in bytes), and a file format. Typically in DSpace, the Bitstream will the "full text" article, or some other media. Some files are the actual file that was uploaded (tagged with bundleName:ORIGINAL), others are DSpace-generated files that are derivatives or renditions, such as text-extraction, or thumbnails. You can download files/bitstreams. DSpace doesn't really limit the type of files that it takes in, so this could be PDF, JPG, audio, video, zip, or other. Also, the logo for a Collection or a Community, is also a Bitstream.

HTTP methodREST endpointDescription
GET/bitstreams

...

Return all bitstreams

...

.
GET/bitstreams/{bitstream id}

...

Return bitstream.
GET/bitstreams/{bitstream id}/policy

...

Return bitstream policies.
GET/bitstreams/{bitstream id}/retrieve

...

Return data of bitstream.
POST/bitstreams/{bitstream id}/policy

...

Add policy to item. You must post a ResourcePolicy
PUT/bitstreams/{bitstream id}/data

...

Update data/file of bitstream. You must put the data.
PUT/bitstreams/{bitstream id}

...

Update metadata of bitstream. You must put a Bitstream, does not alter the file/data.
DELETE/bitstreams/{bitstream id}

...

Delete bitstream

...

.
DELETE/bitstreams/{bitstream id}/policy/{policy_id}

...

Delete bitstream policy.


You can access the parent object of a Bitstream (normally an Item, but possibly a Collection or Community when it is its logo) through: /bitstreams/:bitstreamID?expand=parent

...

In DSpace, Communities, Collections, and Items typically get minted a Handle Identifier. You can reference these objects in the REST API by their handle, as opposed to having to use the internal item-ID.

HTTP methodREST endpointDescription
GET/handle/{handle-prefix}/{handle-suffix}

...

Returns a Community, Collection, or Item object that matches that handle.

Hierarchy

Assembling a full representation of the community and collection hierarchy using the communities and collections endpoints can be inefficient. Retrieve a lightweight representation of the nested community and collection hierarchy.  Each node of the hierarchy contains minimal information (id, handle, name).

HTTP methodREST endpointDescription
GET/hierarchy

...

Retrieve a lightweight representation of the nested community and collection hierarchy.

Schema and Metadata Field Registry

HTTP methodREST endpointDescription
GET/registries/schema

...

Return the list of schemas in the registry
GET/registries/schema/{schema_prefix}

...

Returns the specified schema
GET/registries/schema/{schema_prefix}/metadata-fields/{element}

...

Returns the metadata field within a schema with an unqualified element name
GET/registries/schema/{schema_prefix}/metadata-fields/{element}/{qualifier}

...

Returns the metadata field within a schema with a qualified element name

...

GET/registries/

...

metadata-fields/{field_id}Add a schema to the schema registry
POST/registries/schema

...

/Add a metadata field to the specified schema
POST

...

/registries/

...

schema/{

...

schema_

...

prefix}/metadata-fieldsReturn the specified metadata field
PUT/registries/metadata-fields/{field_id}

...

Update the specified metadata field
DELETE/registries/metadata-fields/{field_id}

...

Delete the specified metadata field from the metadata field registry
DELETE/registries/schema/{schema_id}

...

Delete the specified schema from the schema registry


Note: since the schema object contains no data fields, the following method has not been implemented: PUT /registries/schema/{schema_id}

...

Reporting Tools that allow a repository manager to audit a collection for metadata consistency and bitstream consistency.  See REST Based Quality Control Reports for more information .or test the Collection Report Tool on demo.dspace.org or Metadata Query Tool on  on demo.dspace.org.

HTTP methodREST endpointDescription
GET/reports

...

Return a list of report tools built on the rest api
GET/reports/{nickname}

...

Return a redirect to a specific report
GET/filters

...

Return a list of use case filters available for quality control reporting
GET/filtered-collections

...

Return collections and item counts based on pre-defined filters
GET/filtered-collections/{collection_id}

...

Return items and item counts for a collection based on pre-defined filters
GET/filtered-items

...

Retrieve a set of items based on a metadata query and a set of filters


Model - Object data types

Here are all of the data types, not all fields are necessary or supported when posting/putting content, but the output contains this information:

Community Object

Anchor
Community Object
Community Object

Code Block
{ "id":456,
  "name":"Reports Community",
  "handle":"10766/10213",
  "type":"community",
  "link":"/rest/communities/456",
  "expand":["parentCommunity","collections","subCommunities","logo","all"],
  "logo":null,
  "parentCommunity":null,
  "copyrightText":"",
  "introductoryText":"",
  "shortDescription":"Collection contains materials pertaining to the Able Family",
  "sidebarText":"",
  "countItems":3,
  "subcommunities":[],
  "collections":[]
}

...