Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 4.0

...

For examples of how to use the REST API programmatically, please refer to the TestRESTAPI test class (http://fedora-commons.svn.sourceforge.net/viewvc/*checkout*/fedora-commons/fedora/tags/release-3.0/src/test/junit/fedora/test/api/TestRESTAPI.java).

Warning
titleEnsure DC, RELS-EXT and RELS-INT are versionable if using Managed Content

Due to an outstanding bug FCREPO-849, if you use Managed Content for DC, RELS-EXT or RELS-INT then please make sure these datastreams are versionable (the default setting for versionable is "true", so if you haven't specified this datastream property then you are safe). Ensure that you don't inadvertently set this property to "false" for these datastreams when using the API methods.

...

/objects ? \ [terms \ | query\] \ [maxResults\] \ [resultFormat\] \ [pid\] \ [label\] \ [state\] \ [ownerId\] \ [cDate\] \ [mDate\] \ [dcmDate\] \ [title\] \ [creator\] \ [subject\] \ [description\] \ [publisher\] \ [contributor\] \ [date\] \ [type\] \ [format\] \ [identifier\] \ [source\] \ [language\] \ [relation\] \ [coverage\] \ [rights\]

HTTP Method

GET

HTTP Response

200

Parameters

Panel
bgColorwhite
borderStylenone

URL Syntax

Wiki Markup

Name

Description

Default

Options

terms

a phrase represented as a sequence of characters (including the ? and * wildcards) for the search. If this sequence is found in any of the fields for an object, the object is considered a match. Do NOT use this parameter in combination with the "query" parameter

 

 

query

a sequence of space-separated conditions. A condition consists of a metadata element name followed directly by an operator, followed directly by a value. Valid element names are (pid, label, state, ownerId, cDate, mDate, dcmDate, title, creator, subject, description, publisher, contributor, date, type, format, identifier, source, language, relation, coverage, rights). Valid operators are: contains (), equals (=), greater than (>), less than (<), greater than or equals (>=), less than or equals (<=). The contains () operator may be used in combination with the ? and * wildcards to query for simple string patterns. Space-separators should be encoded in the URL as %20. Operators must be encoded when used in the URL syntax as follows: the (=) operator must be encoded as %3D, the (>) operator as %3E, the (<) operator as %3C, the (>=) operator as %3E%3D, the (<=) operator as %3C%3D, and the (~) operator as %7E. Values may be any string. If the string contains a space, the value should begin and end with a single quote character ('). If all conditions are met for an object, the object is considered a match. Do NOT use this parameter in combination with the "terms" parameter

 

 

maxResults

the maximum number of results that the server should provide at once. If this is unspecified, the server will default to a small value

25

 

resultFormat

the preferred output format

html

xml, html

pid

if true, the Fedora persistent identifier (PID) element of matching objects will be included in the response

false

true, false

label

if true, the Fedora object label element of matching objects will be included in the response

false

true, false

state

if true, the Fedora object state element of matching objects will be included in the response

false

true, false

ownerId

if true, each matching objects' owner id will be included in the responsefalsetrue, false

false

true, false

cDate

if true, the Fedora create date element of matching objects will be included in the response

false

true, false

mDate

if true, the Fedora modified date of matching objects will be included in the response

false

true, false

dcmDate

if true, the Dublin Core modified date element(s) of matching objects will be included in the response

false

true, false

title

if true, the Dublin Core title element(s) of matching objects will be included in the response

false

true, false

creator

if true, the Dublin Core creator element(s) of matching objects will be included in the response

false

true, false

subject

if true, the Dublin Core subject element(s) of matching objects will be included in the response

false

true, false

description

if true, the Dublin Core description element(s) of matching objects will be included in the response

false

true, false

publisher

if true, the Dublin Core publisher element(s) of matching objects will be included in the response

false

true, false

contributor

if true, the Dublin Core contributor element(s) of matching objects will be included in the response

false

true, false

date

if true, the Dublin Core date element(s) of matching objects will be included in the response

false

true, false

type

if true, the Dublin Core type element(s) of matching objects will be included in the response

false

true, false

format

if true, the Dublin Core format element(s) of matching objects will be included in the response

false

true, false

identifier

if true, the Dublin Core identifier element(s) of matching objects will be included in the response

false

true, false

source

if true, the Dublin Core source element(s) of matching objects will be included in the response

false

true, false

language

if true, the Dublin Core language element(s) of matching objects will be included in the response

false

true, false

relation

if true, the Dublin Core relation element(s) of matching objects will be included in the response

false

true, false

coverage

if true, the Dublin Core coverage element(s) of matching objects will be included in the response

false

true, false

rights

if true, the Dublin Core rights element(s) of matching objects will be included in the response

false

true, false

Examples

/objects?terms=demo&pid=true&subject=true&label=true&resultFormat=xml

/objects?query=title%7Erome%20creator%7Estaples&pid=true&title=true&creator=true

/objects?query=pid%7E*1&maxResults=50&format=true&pid=true&title=true

...

Panel
bgColorwhite
borderStylenone

URL Syntax

URL Syntax

unmigrated-wiki-markup

/objects/\{pid\}/datastreams/\{dsID\}/content ? \ [asOfDateTime\] \ [download\]

HTTP Method

GET

HTTP Response

200

Parameters

Name

Description

Default

Options

{pid}

persistent identifier of the digital object

 

 

{dsID}

datastream identifier

 

 

asOfDateTime

indicates that the result should be relative to the digital object as it existed at the given date and time

 

yyyy-MM-dd or yyyy-MM-ddTHH:mm:ssZ

download

If true,  a content-disposition header value "attachment" will be included in the response, prompting the user to save the datastream as a file.  A content-disposition header value "inline" will be used otherwise.  The filename used in the header is generated by examining in order: RELS-INT for the relationship fedora-model:downloadFilename, the datastream label, and the datastream ID.  The file extension (apart from where the filename is specified in RELS-INT) is determined from the MIMETYPE.  The order in which these filename sources are searched, and whether or not to generate an extension from the MIMETYPE, is configured in fedora.fcfg.  The file used to map between MIMETYPEs and extensions is mime-to-extensions.xml located in the server config directory.

 

 

Examples

/objects/demo:29/datastreams/DC/content

/objects/demo:29/datastreams/DC/content?asOfDateTime=2008-01-01

...

Panel
bgColorwhite
borderStylenone

URL Syntaxunmigrated-wiki-markup

/objects/\{pid\}/methods/\{sdefPid\}/\{method} ? \ [method parameters\]

HTTP Method

GET

HTTP Response

200

Parameters

Name

Description

Default

Options

{pid}

persistent identifier of the digital object

 

 

{sdefPid}

persistent identifier of the sDef defining the methods

 

 

{method}

method to invoke

 

 

method parameters

any parameters required by the method

 

 

Examples

/objects/demo:29/methods/demo:27/resizeImage?width=100

/objects/demo:SmileyEarring/methods/demo:DualResolution/fullSize

...

Panel
bgColorwhite
borderStylenone

URL Syntaxunmigrated-wiki-markup

/objects/\{pid\}/versions ? \ [format\]

HTTP Method

GET

HTTP Response

200

Parameters

Name

Description

Default

Options

{pid}

persistent identifier of the digital object

 

 

format

the preferred output format

html

xml, html

Examples

/objects/demo:29/versions

/objects/demo:29/versions?format=xml

...

/objects/\{pid\} ? \ [format\] \ [asOfDateTime\]

HTTP Method

GET

HTTP Response

200

Parameters

Panel
bgColorwhite
borderStylenone

URL Syntax

Wiki Markup

Name

Description

Default

Options

{pid}

persistent identifier of the digital object

 

 

format

the preferred output format

html

xml, html

asOfDateTime

indicates that the result should be relative to the digital object as it existed on the given date

 

yyyy-MM-dd or yyyy-MM-ddTHH:mm:ssZ

Examples

/objects/demo:29

/objects/demo:29?format=xml

/objects/demo:29?asOfDateTime=2008-01-01

...

Panel
bgColorwhite
borderStylenone

URL Syntaxunmigrated-wiki-markup

/objects/\{pid\}/datastreams ? \ [format\] \ [asOfDateTime\]

HTTP Method

GET

HTTP Response

200

Parameters

Name

Description

Default

Options

{pid}

persistent identifier of the digital object

 

 

format

the preferred output format

html

xml, html

asOfDateTime

indicates that the result should be relative to the digital object as it existed on the given date

 

yyyy-MM-dd or yyyy-MM-ddTHH:mm:ssZ

Examples

/objects/demo:35/datastreams

/objects/demo:35/datastreams?format=xml&asOfDateTime=2008-01-01T05:15:00Z

...

Panel
bgColorwhite
borderStylenone

URL Syntax

unmigrated-wiki-markup

  1. /objects/\{pid\}/methods ? \ [format\] \ [asOfDateTime\]unmigrated-wiki-markup
  2. /objects/\{pid\}/methods/\{sdefPid} ? \ [format\] \ [asOfDateTime\]

HTTP Method

GET

HTTP Response

200

Parameters

Name

Description

Default

Options

{pid}

persistent identifier of the digital object

 

 

{sdefPid}

persistent identifier of the SDef defining the methods

 

 

format

the preferred output format

html

xml, html

asOfDateTime

indicates that the result should be relative to the digital object as it existed on the given date

 

yyyy-MM-dd or yyyy-MM-ddTHH:mm:ssZ

Examples

/objects/demo:29/methods

/objects/demo:29/methods?format=xml&asOfDateTime=2008-01-01T05:15:00Z

/objects/demo:29/methods/demo:27

/objects/demo:29/methods/demo:27?format=xml&asOfDateTime=2008-01-01T05:15:00Z

...

/objects ? \ [sessionToken\] \ [all findObjects options\]

HTTP Method

GET

HTTP Response

200

Parameters

Panel
bgColorwhite
borderStylenone

URL Syntax

Wiki Markup

Name

Description

Default

Options

sessionToken

the identifier of the session to which the search results are being returned

 

 

all findObjects options

all of the same options are available for resumeFindObjects as for findObjects