REST API docsGeneral principles
Repository ResourcesGET /objects - search objectsPOST /objects/nextPid - generate pidObject ResourcesGET /objects/{pid} - get object profileGET /objects/{pid}?[asOfDateTime][format]
Profile of an object, which includes key metadata fields and URLs for the object Dissemination Index and the object Item Index. Can be thought of as a default view of the object.
Examples: Example of html formatTODO Example of xml formatWithout asOfDateTime set <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> With asOfDateTime set <objectProfile pid="demo:testObject" datetime="2008-09-29T03:49:450Z"> <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/2008-09-29T03:49:450Z</objDissIndexViewURL> <objItemIndexViewURL>http://localhost:8080/fedora/get/demo:testObject/fedora-system:3/viewItemIndex/2008-09-29T03:49:450Z</objItemIndexViewURL> <objState>A</objState> </objectProfile> Schema for XML return value <?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="objectProfile"> <xs:complexType> <xs:sequence> <xs:element ref="objLabel" /> <xs:element ref="objOwnerId" /> <xs:element ref="objModels" /> <xs:element ref="objCreateDate" /> <xs:element ref="objLastModDate" /> <xs:element ref="objDissIndexViewURL" /> <xs:element ref="objItemIndexViewURL" /> <xs:element ref="objState" /> </xs:sequence> <xs:attribute name="pid" use="required"> <xs:simpleType> <xs:restriction base="xs:string" /> </xs:simpleType> </xs:attribute> <xs:attribute name="datetime" use="optional"> <xs:simpleType> <xs:restriction base="xs:dateTime" /> </xs:simpleType> </xs:attribute> </xs:complexType> </xs:element> <xs:element name="objCreateDate"> <xs:simpleType> <xs:restriction base="xs:dateTime" /> </xs:simpleType> </xs:element> <xs:element name="objDissIndexViewURL"> <xs:simpleType> <xs:restriction base="xs:anyURI" /> </xs:simpleType> </xs:element> <xs:element name="objItemIndexViewURL"> <xs:simpleType> <xs:restriction base="xs:anyURI" /> </xs:simpleType> </xs:element> <xs:element name="objLabel"> <xs:simpleType> <xs:restriction base="xs:string" /> </xs:simpleType> </xs:element> <xs:element name="objOwnerId"> <xs:simpleType> <xs:restriction base="xs:string" /> </xs:simpleType> </xs:element> <xs:element name="objModels"> <xs:complexType> <xs:sequence> <xs:element name="model" minOccurs="0" maxOccurs="unbounded" type="xs:string" /> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="objLastModDate"> <xs:simpleType> <xs:restriction base="xs:dateTime" /> </xs:simpleType> </xs:element> <xs:element name="objState"> <xs:simpleType> <xs:restriction base="xs:string" /> </xs:simpleType> </xs:element> </xs:schema> DELETE /objects/{pid} - purge objectDELETE /objects/{pid}?[logMessage][force]
Permanently removes an object from the repository.
TODO POST /objects/{pid} - ingest or create new objectPUT /objects/{pid} - modify objectPUT /objects/{pid}?[label][logMessage][ownerId][state] Modify an object. Modifies only the object level properties, ie. label, ownerId and state.
TODO GET /objects/{pid}\exportGET /objects/{pid}\versionsGET /objects/{pid}/versions?[format] 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. Please note that this timestamp list is generated by requesting the timestamp list of all CURRENTLY Active datastreams, and sorting it. Inactive and Deleted datastreams are disregarded. See http://fedora-commons.org/jira/browse/FCREPO-610 Please note that this timestamp list does not include changes to object properties, but only datastream changes.
Example of html formatTODO Example of xml formatExampe of xml return <fedoraObjectHistory pid="demo:testObject"> <!--1 or more repetitions:--> <objectChangeDate>2008-09-29T03:49:450Z</objectChangeDate> <objectChangeDate>2008-10-29T05:47:000Z</objectChangeDate> </fedoraObjectHistory> Xml schema <?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> TODO GET /objects/{pid}\objectXMLDatastream ResourcesGET /objects/{pid}/datastreams - list datastreamsInquires 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. GET /objects/{pid}/datastreams?[asOfDateTime][format]
Example of html formatTODO Example of xml formatExampe of xml return <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> The asOfDateTime attribute is not present if the parameter was not specified. The baseURL is the used to create datastream urls, as in baseURL+pid+/+dsId. The label and the mimeType will be empty strings if they are not specified for the particular datastream Xml schema <?xml version="1.0" encoding="UTF-8"?> <xsd:schema targetNamespace="info:fedora/fedora-system:def/listDatastreams#" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="info:fedora/fedora-system:def/listDatastreams#" elementFormDefault="qualified"> <!-- root element declaration --> <xsd:element name="objectDatastreams"> <xsd:complexType> <xsd:complexContent> <xsd:extension base="objectDatastreamsType"/> </xsd:complexContent> </xsd:complexType> </xsd:element> <!-- complex type declarations --> <xsd:complexType name="objectDatastreamsType"> <xsd:sequence> <xsd:element name="datastream" type="datastreamType" minOccurs="0" maxOccurs="unbounded"/> </xsd:sequence> <xsd:attribute name="pid" type="xsd:string" use="required"/> <xsd:attribute name="asOfDateTime" type="xsd:string" use="optional"/> <xsd:attribute name="baseURL" type="xsd:string" use="required"/> </xsd:complexType> <xsd:complexType name="datastreamType"> <xsd:attribute name="dsid" type="xsd:string" use="required"/> <xsd:attribute name="label" type="xsd:string" use="required"/> <xsd:attribute name="mimeType" type="xsd:string" use="required"/> </xsd:complexType> </xsd:schema> GET /objects/{pid}/datastreams/{dsID} - get datastream profileGET /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.
Example of html formatTODO Example of xml format<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> Notes:
Xml schema <?xml version="1.0" encoding="UTF-8"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"> <xs:element name="datastreamProfile"> <xs:complexType> <xs:sequence> <xs:element name="dsLabel" type="xs:string" /> <xs:element name="dsVersionID" type="xs:string" /> <xs:element name="dsCreateDate" type="xs:dateTime" /> <xs:element name="dsState"> <xs:simpleType> <xs:restriction base="xs:string"> <xs:enumeration value="A"/> <xs:enumeration value="D"/> <xs:enumeration value="I"/> </xs:restriction> </xs:simpleType> </xs:element> <xs:element name="dsMIME" type="xs:string" /> <xs:element name="dsFormatURI" type="xs:anyURI" /> <xs:element name="dsControlGroup" > <xs:simpleType> <xs:restriction base="xs:string"> <xs:enumeration value="X"/> <xs:enumeration value="M"/> <xs:enumeration value="R"/> <xs:enumeration value="E"/> </xs:restriction> </xs:simpleType> </xs:element> <xs:element name="dsSize" type="xs:integer" /> <xs:element name="dsVersionable" > <xs:simpleType> <xs:restriction base="xs:string"> <xs:enumeration value="true"/> <xs:enumeration value="false"/> </xs:restriction> </xs:simpleType> </xs:element> <xs:element name="dsInfoType" type="xs:string" /> <xs:element name="dsLocation" type="xs:string" /> <xs:element name="dsLocationType" type="xs:string" /> <xs:element name="dsChecksumType" > <xs:simpleType> <xs:restriction base="xs:string"> <xs:enumeration value="DEFAULT"/> <xs:enumeration value="DISABLED"/> <xs:enumeration value="MD5"/> <xs:enumeration value="SHA-1"/> <xs:enumeration value="SHA-256"/> <xs:enumeration value="SHA-385"/> <xs:enumeration value="SHA-512"/> <xs:enumeration value="HAVAL"/> <xs:enumeration value="TIGER"/> <xs:enumeration value="WHIRLPOOL"/> </xs:restriction> </xs:simpleType> </xs:element> <xs:element name="dsChecksum" type="xs:string" /> <xs:element name="dsChecksumValid" minOccurs="0"> <xs:simpleType> <xs:restriction base="xs:string"> <xs:enumeration value="true"/> <xs:enumeration value="false"/> </xs:restriction> </xs:simpleType> </xs:element> <xs:element name="dsAltID" minOccurs="0" maxOccurs="unbounded" type="xs:string" /> </xs:sequence> <xs:attribute name="pid" use="required"> <xs:simpleType> <xs:restriction base="xs:string" /> </xs:simpleType> </xs:attribute> <xs:attribute name="dsID" use="required"> <xs:simpleType> <xs:restriction base="xs:string" /> </xs:simpleType> </xs:attribute> </xs:complexType> </xs:element> </xs:schema> DELETE /objects/{pid}/datastreams/{dsID} - purge datastreamDELETE /objects/{pid}/datastreams/{dsID}?[startDT][endDT][logMessage][force]
If called without startDT and endDT all versions will be purged, along with the datastream itself.
PUT /objects/{pid}/datastreams/{dsID} - modify datastreamPUT /objects/{pid}/datastreams/{dsID}?[dsLocation][altIDs][dsLabel][versionable][dsState][formatURI][checksumType][checksum][mimeType][logMessage][force][ignoreContent] The behaivour depends on the datastream controlGroup and the content provided and the ignoreContent parameter
Modify an existing datastream, by creating a new version of the datastream. If the datastream is versionable, the old version is kept, otherwise it is deleted. Each request will generate a new version, but one request (that changes numerous properties) will only generate one object. The default for all the parameters is not to change the existing value. Not all properties are versionable, so changing these will not generate a new version: These are
Note the order of the changes
If the datastream is in the D(eleted) state, it cannot be modified, and return code 500 is given. Except, if the request modify both the datastream and sets the state to A(ctive) or I(nactive). Note, only the old state is checked, it is possible to modify a datastream and set it to deleted in one operation.
POST /objects/{pid}/datastreams/{dsID} - modify or create datastreamPOST /objects/{pid}/datastreams/{dsID}?[controlGroup][dsLocation][altIDs][dsLabel][versionable][dsState][formatURI][checksumType][checksum][mimeType][logMessage] 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. If the datastream does not exist already, it is created with the specified control group.
If the datastream already exist, the provided control group is disregarded and the one from the existing datastream is used
Return values
Method Resources
|