Get All Metadata
REST Api operation which retrieves all the metadata associated with a record on the Shared Records server using http-get.
Synopsis
Submit
GET /<RESTServletPath>/?prefix=<RecordID>/log/&format=<Format> HTTP/1.1 Host: <RESTHost:RESTPort>
Fields:
- RESTServletPath
- Path to the REST Servlet on the host. Example: records
- RESTHost
- IP address of Shared Records server. Example: sra.sharedrecords.org
- RESTPort
- Network port of the Shared Records server. Example: 8080 (default port 80 is preferred for sra.sharedrecords.org)
- RecordID
- The unique ID of the stored record. (The SHA1 hash of the stored data)
- Format
- The format in which the metadata should be returned, either "xml" or "json".
Headers:
None.
Body:
None.
Response
HTTP/1.1 100 Continue HTTP/1.1 200 OK X-Powered-By: Servlet/2.4 Content-Type: <ContentType> Content-Length: <ContentLength>
Headers:
- Content-Type
- An appropriate mime-type for the format of the metadata returned in the body.
- Content-Length
- The length in bytes of the body.
Body:
The body will contain the most recent metadata entries, formatted as requested.
Examples
Command-line
The following command-line example uses the common unix "curl" utility to retrieve metadata about a record and save it in a file named "metadata.xml".
$ curl --verbose --output all-metadata.xml \ "http://sra.sharedrecords.org/records/?prefix=8e636b1c0af14814fc67748ab54a3aa7d01893fb/log/&format=xml"
Note: the "\" character is used to indicate that the line continues. To copy-and-paste this command, remove those characters and any whitespace in the URI.
Notes
- We may want to provide additional API's. Getting all entries with a particular title (i.e. version history) is easy with our current scheme. We can also support "last N", although this requires some server-side logic.
