Amazon Quantum Ledger Database (Amazon QLDB)
Developer Guide

GetRevision

Returns a revision data object for a specified document ID and block address. Also returns a proof of the specified revision for verification if DigestTipAddress is provided.

Request Syntax

POST /ledgers/name/revision HTTP/1.1 Content-type: application/json { "BlockAddress": { "IonText": "string" }, "DigestTipAddress": { "IonText": "string" }, "DocumentId": "string" }

URI Request Parameters

The request requires the following URI parameters.

name

The name of the ledger.

Length Constraints: Minimum length of 1. Maximum length of 32.

Pattern: (?!^.*--)(?!^[0-9]+$)(?!^-)(?!.*-$)^[A-Za-z0-9-]+$

Request Body

The request accepts the following data in JSON format.

BlockAddress

The block location of the document revision to be verified. An address is an Amazon Ion structure that has two fields: strandId and sequenceNo.

For example: {strandId:"BlFTjlSXze9BIh1KOszcE3",sequenceNo:14}

Type: ValueHolder object

Required: Yes

DigestTipAddress

The latest block location covered by the digest for which to request a proof. An address is an Amazon Ion structure that has two fields: strandId and sequenceNo.

For example: {strandId:"BlFTjlSXze9BIh1KOszcE3",sequenceNo:49}

Type: ValueHolder object

Required: No

DocumentId

The unique ID of the document to be verified.

Type: String

Length Constraints: Fixed length of 22.

Pattern: ^[A-Za-z-0-9]+$

Required: Yes

Response Syntax

HTTP/1.1 200 Content-type: application/json { "Proof": { "IonText": "string" }, "Revision": { "IonText": "string" } }

Response Elements

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

Proof

The proof object in Amazon Ion format returned by a GetRevision request. A proof contains the list of hash values that are required to recalculate the specified digest using a Merkle tree, starting with the specified document revision.

Type: ValueHolder object

Revision

The document revision data object in Amazon Ion format.

Type: ValueHolder object

Errors

For information about the errors that are common to all actions, see Common Errors.

InvalidParameterException

One or more parameters in the request aren't valid.

HTTP Status Code: 400

ResourceNotFoundException

The specified resource doesn't exist.

HTTP Status Code: 404

ResourcePreconditionNotMetException

The operation failed because a condition wasn't satisfied in advance.

HTTP Status Code: 412

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: