ProxyPut

ProxyApi operation which encrypts the body of the http-put request and stores it on the server.

Synopsis

Submit

PUT /<ProxyServletPath>/ HTTP/1.1
Host: <ProxyHost:ProxyPort>
x-amz-meta-<Option>: <Value>
Content-Length: <ContentLength>
Account-IDs: <Id1> <Id2> <Id3> ...
Expect: 100-continue

Fields:

ProxyServletPath
Path to the Proxy Servlet on the host. Example: /SharedRecordsProxyServer/
ProxyHost
IP address of Shared Records server. Example: sra.sharedrecords.org
ProxyPort
Network port of the Shared Records server. Example: 8080

Headers:

x-amz-meta-<Option>
Optional header information passed with the data, which will be stored by the server. Example: x-amz-meta-username
Content-Length
Length of data in body.
Account-IDs
(Optional) Space-separated list of account ids in which to deposit a document key for the record. (This is a NEW feature still in development)

Body:

The data to store on the Shared Records server.

Response

HTTP/1.1 100 Continue
HTTP/1.1 200 OK
X-Powered-By: Servlet/2.4
Record-ID: <RecordID>
Unencrypted-Record-ID: <UnencryptedRecordId>
Content-Type: text/html; charset=iso-8859-1
Transfer-Encoding: chunked
Successful-Account-IDs: <Id1> <Id2> ...
Failed-Account-IDs: <Id1> <Id2> ... 

Headers:

Record-ID
The unique RecordID of the stored data.
Unencrypted-Record-ID
The SHA-1 of the unencrypted content that was submitted. This content is not stored.
Successful-Account-IDs
A space separated list of all account ids where the record was successfully deposited. This will not be in the response if it is empty.
Failed-Account-IDs
A space separated list of all account ids where the record was NOT successfully deposited (usually because there was no public key for that account). This will not be in the response if it is empty.

Body:

A QR Code Token, presented as JPEG image data.

Examples

Command-line

The following command-line example uses the common unix "curl" utility to upload a file named "original.txt" to the Shared Records server. The resulting QR Code Token is saved to a file named "original.txt.token.jpg".

curl --upload-file original.txt \
http://sra.sharedrecords.org:8080/SharedRecordsProxyServer/ > original.txt.token.jpg

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.