Record Retrieve

REST Api operation which retrieves a record from the Shared Records server using http-get.

Synopsis

Submit

GET /<RESTServletPath>/<RecordID>.data HTTP/1.1
Host: <RESTHost:RESTPort>

Fields:

RESTServletPath
Path to the REST Servlet on the host. Example: records
RecordID
The unique ID of the stored record. (The SHA1 hash of the stored data)
RESTHost
IP address of Shared Records server. Example: sra.sharedrecords.org
RESTPort
Network port of the Shared Records server. Example: 8080 (default 80)

Headers:

None.

Body:

None.

Response

HTTP/1.1 100 Continue
HTTP/1.1 200 OK
X-Powered-By: Servlet/2.4
Content-Type: text/html; charset=iso-8859-1
Content-Length: 0
x-amz-meta-<Option>: <Value>

Headers:

Content-Type
This is set to the same value you specified in the corresponding header when the data was PUT. The default content type is binary/octet-stream.
Content-Disposition
This is set to the same value you specified in the corresponding header when the data was PUT. If no Content-Disposition was specified at the time of PUT then this header is not returned.
x-amz-meta-<Option>
Each metadata header which was supplied when the record was deposited will be returned exactly as it was submitted.
x-amz-meta-last-metadata-entry
The name (<Title>_<PaddedSequenceNumber>_<RollingChecksum>) of the last metadata entry for all metadata entries associated with this record. Not set if no metadata has been added. This can be used in the get single metadata operation
Max-Metadata-Sequence-Number
The maximum sequence number for all metadata entries associated with this record. This is used in the add metadata operation.

Body:

The body will contain the data of the shared record.

Examples

Command-line

The following command-line example uses the common unix "curl" utility to retrieve a record and save it in a file named "retrieved.txt".

$ curl --verbose --output retrieved.txt http://sra.sharedrecords.org/records/8e636b1c0af14814fc67748ab54a3aa7d01893fb.data

Note: the "\" character is used to indicate that the line continues. To copy-and-paste this command, remove those characters and remove whitespace in the URI.

Notes

HTTP/1.1 302 Moved Temporarily

This usually indicates a problem on the server-side. Check the data store and related settings in the org.sharedrecords.properties file, particularly...

  • org.sharedrecords.core.DataStoreMode
  • org.sharedrecords.core.FileStoreRoot

If the settings are all correct and you are using a local data store, make sure that the path to the data store is correct and that the data store has been initialized.

HTTP/1.1 404 Not Found

Indicates that the requested record doesn't exist on the server.