...
Content | Location |
---|---|
search objects | GET/objects |
nextPid | POST /objects/nextPid |
Object | GET/DELETE/POST/PUT /objects/{pid} |
Object Export | GET /objects/{pid}\export |
Object Versions | GET /objects/{pid}\versions |
Object XML | GET /objects/{pid}\objectXML |
Datastreams | GET/objects/{pid}/datastreams |
Specific datastream | GET/DELETE/PUT/POST /objects/{pid}/datastreams/{dsID} |
content of Datastream | GET/objects/{pid}/datastreams/{dsID}/content |
List Methods on Object | GET/objects/{pid}/methods |
list methods for sdef on Object | GET/objects/{pid}/methods/{sdef} |
get-invoke method | GET/objects/{pid}/methods/{sdef}/{method} |
Repository Resources
GET /objects - search objects
POST /objects/nextPid - generate pid
Object Resources
GET /objects/{pid} - get object profile
...
GET /objects/\{pid}?\[asOfDateTime\]\[format\]
Parameter | Format | Meaning | Default | Example |
---|---|---|---|---|
asOfDateTime | yyyy-MM-ddTHH:mm:ss.SSSZ | The object, as it looked at the specified time | Now | 2009-01-01T03:00:00:000Z |
format | one of text/xml, text/html, html, xml | The format of the return value | text/html | text/xml |
...
Examples:
Get the object profile of the object as it looked at the specified date in the xml format
GET /objects/{pid}?asOfDateTime=2009-01-01T03:00:00:000Z&format=text/xml
Example of html format
TODO
Example of xml format
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
<objectProfile pid="demo:testObject"> <objLabel>label</objLabel> <objOwnerId>fedoraAdmin</objOwnerId> <objModels> <model>info:fedora/demo:ContentModel</model> </objModels> <objCreateDate>2008-09-29T03:49:450Z</objCreateDate> <objLastModDate>2014-09-19T01:18:330Z</objLastModDate> <objDissIndexViewURL>http://localhost:8080/fedora/get/demo:testObject/fedora-system:3/viewMethodIndex</objDissIndexViewURL> <objItemIndexViewURL>http://localhost:8080/fedora/get/demo:testObject/fedora-system:3/viewItemIndex</objItemIndexViewURL> <objState>A</objState> </objectProfile> |
...
DELETE /objects/{pid} - purge object
...
DELETE /objects/\{pid}?\[logMessage\]\[force\]
Parameter | Format | Meaning | Default | Example |
---|---|---|---|---|
logMessage | String | The message to store in the log, about the purge | Empty string | "Deleted this object because it was not used anymore" |
force | one of true, false | Force the purge, even it it breaks a data contract. If set to true, the request will fail, a general exception will be thrown and the return code will be 500. See http://fedora-commons.org/jira/browse/FCREPO-609 | false | false |
...
Return code | Meaning |
---|---|
200 | OK, purging the object, no return body |
404 | Object not found in repository. Body is exception as text/plain |
401 | Unauthorized, the security policy forbade this operation with the supplied user credentials. Body as exception as text/plain |
400 | Wrong syntax in request. Exception as body, text/plain |
500 | Other, unknown error encountered |
...
POST /objects/{pid} - ingest or create new object
...
POST /objects/ [{pid}
...
PUT /objects/\{pid}?\| new] ? [label] \[logMessage]\[ownerId]\[state][format] [encoding] [namespace] [ownerId][logMessage] [ignoreMime] Wiki Markup
Return code | Meaning |
---|---|
201 | OK, purging the object, no return body |
404 | Object not found in repository. Body is exception as text/plain |
401 | Unauthorized, the security policy forbade this operation with the supplied user credentials. Body as exception as text/plain |
400 | Wrong syntax in request. Exception as body, text/plain |
500 | Other, unknown error encountered |
Parameter | Format | Meaning | Default | Example |
---|
logMessage | String | The message to store in the log | Empty string | "Log message about the ingest" |
{pid} | pid format | persistent identifier of the object to be created |
new | indicator that either a new PID should be created for this object or that the PID to be used is encoded in the XML included as the body of the request
| | |
label | String | the label of the new object | Empty string |
|
format | one of info:fedora/fedora-system:FOXML-1.1, info:fedora/fedora-system:FOXML-1.0, info:fedora/fedora-system:METSFedoraExt-1.1, info:fedora/fedora-system:METSFedoraExt-1.0, info:fedora/fedora-system:ATOM-1.1 or info:fedora/fedora-system:ATOMZip-1.1 | the XML format of the object to be ingested | info:fedora/fedora-system:FOXML-1.1 |
|
encoding | The encoding names known by the JVM | the encoding of the XML to be ingested | UTF-8 |
|
namespace | the namespace to be used to create a PID for a new empty object; if object XML is included with the request, the namespace parameter is ignored | the default namespace of the repository |
|
ownerId | the id of the user to be listed at the object owner |
|
|
logMessage | a message describing the activity being performed |
|
|
ignoreMime | indicates that the request should not be checked to ensure that the content is XML prior to attempting an ingest. This is provided to allow for client applications which do not indicate the correct Content-Type when submitting a request. | false | true, false |
XML file as request content | file to be ingested as a new object |
|
|
Examples
POST: /objects/new
POST: /objects/new?namespace=demo
POST: /objects/test:100?label=Test
PUT /objects/{pid} - modify object
PUT /objects/{pid}?[label][logMessage][ownerId][state]
Modify an object. Modifies Modify an object. Modifies only the object level properties, ie. label, ownerId and state.
...
Return code | Meaning |
---|---|
200 | OK, Modifying the object, no return body |
404 | Object not found in repository. Body is exception as text/plain |
401 | Unauthorized, the security policy forbade this operation with the supplied user credentials. Body as exception as text/plain |
400 | Wrong syntax in request. Exception as body, text/plain |
500 | Other, unknown error encountered |
...
GET /objects/{pid}\export
GET /objects/{pid}\versions
GET /objects/\{pid}/versions?\[format] Wiki Markup
Gets a list of timestamps indicating when components changed in an object. This is a set of timestamps indicating when a datastream was created or modified in the object. These timestamps can be used to request a timestamped dissemination request to view the object as it appeared at a specific point in time.
...
Return code | Meaning |
---|---|
200 | OK, Object history in the specified format |
404 | Object not found in repository. Body is exception as text/plain |
401 | Unauthorized, the security policy forbade this operation with the supplied user credentials. Body as exception as text/plain |
400 | Wrong syntax in request. Exception as body, text/plain |
500 | Other, unknown error encountered |
Example of html format
TODO
Example of xml format
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
<fedoraObjectHistory pid="demo:testObject"> <!--1 or more repetitions:--> <objectChangeDate>2008-09-29T03:49:450Z</objectChangeDate> <objectChangeDate>2008-10-29T05:47:000Z</objectChangeDate> </fedoraObjectHistory> |
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
<?xml version="1.0" encoding="UTF-8"?> <!--W3C Schema generated by XMLSPY v2004 rel. 2 U (http://www.xmlspy.com)--> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"> <xs:element name="fedoraObjectHistory"> <xs:complexType> <xs:sequence> <xs:element name="objectChangeDate" type="xs:string" maxOccurs="unbounded"/> </xs:sequence> <xs:attribute name="pid" use="required"> <xs:simpleType> <xs:restriction base="xs:string"/> </xs:simpleType> </xs:attribute> </xs:complexType> </xs:element> </xs:schema> |
...
GET /objects/{pid}\objectXML
Datastream Resources
GET /objects/{pid}/datastreams - list datastreams
Inquires upon all object Datastreams to obtain datastreams contained by a digital object. This returns a set of datastream locations that represent all possible datastreams available in the object.unmigrated-wiki-markup
GET /objects/\{pid}/datastreams?\[asOfDateTime]\[format]
Parameter | Format | Meaning | Default | Example |
---|---|---|---|---|
asOfDateTime | yyyy-MM-ddTHH:mm:ss.SSSZ | The datastream list as it looked at the specific time | Now | 2009-01-01T03:00:00:000Z |
format | one of text/xml, text/html, html, xml | The format of the return value | text/html | text/xml |
Return code | Meaning |
---|---|
200 | OK, Return information in the specified format |
404 | Object not found in repository. Body is exception as text/plain |
401 | Unauthorized, the security policy forbade this operation with the supplied user credentials. Body as exception as text/plain |
400 | Wrong syntax in request. Exception as body, text/plain |
500 | Other, unknown error encountered |
Example of html format
TODO
Example of xml format
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
<objectDatastreams pid="demo:testObject" asOfDateTime="2009-01-01T03:00:00:000Z" baseURL="http://localhost:8080/fedora/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.fedora.info/definitions/1/0/access/ http://localhost:8080/fedora/listDatastreams.xsd"> <!--Zero or more repetitions:--> <datastream dsid="DC" label="" mimeType="text/xml"/> </objectDatastreams> |
...
GET /objects/{pid}/datastreams/{dsID} - get datastream profile
...
GET /objects/\{pid}/datastreams/\{dsID}?\[asOfDateTime]\[validateChecksum]
Gets the datastream profile, as it looked at the specified time. The datastream profile is a datastructure containing all the datastream properties, but not the content.
...
Return code | Meaning |
---|---|
200 | OK, Return information in the specified format |
404 | Object or datastream not found in repository. Body is exception as text/plain |
401 | Unauthorized, the security policy forbade this operation with the supplied user credentials. Body as exception as text/plain |
400 | Wrong syntax in request. Exception as body, text/plain |
500 | Other, unknown error encountered |
Example of html format
TODO
Example of xml format
Code Block | ||||
---|---|---|---|---|
| ||||
<datastreamProfile xsi:schemaLocation="http://www.fedora.info/definitions/1/0/management/ http://localhost:8080/datastreamProfile.xsd" pid="changeme:1" dsID="DC" datetime="2009-11-26T15:31:40.099Z"> <dsLabel>Dublin Core Record for this object</dsLabel> <dsVersionID>DC1.0</dsVersionID> <dsCreateDate>2009-11-26T15:31:40.099Z</dsCreateDate> <dsState>A</dsState> <dsMIME>text/xml</dsMIME> <dsFormatURI>http://www.openarchives.org/OAI/2.0/oai_dc/</dsFormatURI> <dsControlGroup>X</dsControlGroup> <dsSize>339</dsSize> <dsVersionable>true</dsVersionable> <dsInfoType/> <dsLocation>changeme:1+DC+DC1.0</dsLocation> <dsLocationType/> <dsChecksumType>DISABLED</dsChecksumType> <dsChecksum>none</dsChecksum> </datastreamProfile> |
...
DELETE /objects/{pid}/datastreams/{dsID} - purge datastream
DELETE /objects/\{pid}/datastreams/\{dsID}?\[startDT]\[endDT]\[logMessage]\[force] Wiki Markup
Parameter | Format | Meaning | Default | Example |
---|---|---|---|---|
startDT | yyyy-MM-ddTHH:mm:ss.SSSZ | Purge the datastream versions created after this date | From the beginning | 2009-01-01T03:00:00:000Z |
endDT | yyyy-MM-ddTHH:mm:ss.SSSZ | Purge only versions created before this date | Now | 2009-01-01T03:00:00:000Z |
logMessage | String | The message to store in the log, about the purge | Empty string | "Deleted this datastream because it was not used anymore" |
force | one of true, false | Force the purge, even it it breaks a data contract. If set to true, the request will fail, a general exception will be thrown and the return code will be 500. See http://fedora-commons.org/jira/browse/FCREPO-613 | false | false |
...
PUT /objects/{pid}/datastreams/{dsID} - modify datastream
PUT /objects/\{pid}/datastreams/\{dsID}?\[dsLocation]\[altIDs]\[dsLabel]\[versionable]\[dsState]\[formatURI]\[checksumType]\[checksum]\[mimeType]\[logMessage]\[force]\[ignoreContent]
Wiki Markup
+ multipart file as request content
The behaivour depends on the datastream controlGroup and the content provided and the ignoreContent parameter
...
POST /objects/{pid}/datastreams/{dsID} - modify or create datastream
POST /objects/\{pid}/datastreams/\{dsID}?\[controlGroup]\[dsLocation]\[altIDs]\[dsLabel]\[versionable]\[dsState]\[formatURI]\[checksumType]\[checksum]\[mimeType]\[logMessage]
Wiki Markup
+ multipart file as request content
Modify or create a datastream. Functions almost identical to the above method PUT /objects/{pid}/datastreams/{dsID} but with a few differences. There is no ignoreContent parameter, so the functioning with dsLocation and message content is more complex.
...
Return code | Meaning |
---|---|
201 | Created. Locationheader corresponding the new datastream. Updated or created the datastream. Returns the new datastream profile, like GET /objects/{pid}/datastreams/{dsID}?format=xml |
404 | Object or datastream not found in repository. Body is exception as text/plain |
401 | Unauthorized, the security policy forbade this operation with the supplied user credentials. Body as exception as text/plain. Please note that this request spans multiple fedora methods, and you could thus modify the datastream, but fail to modify the state, and get a 401. The datastream will still be modified, but the state will not be. Many other combinations are also possible. |
400 | Wrong syntax in request. Exception as body, text/plain |
500 | Other, unknown error encountered |