Get Current Metadata
REST Api operation which retrieves the most recent metadata associated with a record on the Shared Records server using http-get. This will be only the most recent metadata entry for each unique title associated with a record.
Synopsis
Submit
GET /<RESTServletPath>/<RecordID>_log.<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 is 80)
- 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 metadata.xml \ http://sra.sharedrecords.org/records/8e636b1c0af14814fc67748ab54a3aa7d01893fb_log.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.
