API Reference for Document Store Service (1.0)

Download OpenAPI specification:Download

Many blockchain use cases require the pinning of on-chain transactions to securely stored documents that cannot be held on-chain, either because they are too large or the information is too sensitive to put into your immutable shared ledger. Kaleido’s Document Store was created for these use cases, providing a private store solely for your individual use. We provide the mechanism to generate hashes that uniquely tie an on-chain asset, token, or transaction to off-chain data.

documentstore

Configuration

Retrieves the document store service configuration

Retrieves the document store service configuration.

Responses

Response samples

Content type
application/json
{
  • "provider": "internal",
  • "region": "string",
  • "bucket_or_container": "string"
}

Documents

Returns root-level entries

Responses

Response samples

Content type
application/json
{
  • "is_truncated": true,
  • "entries": [
    ]
}

Returns document(s) at the path

When the path matches a folder, it retrieves the (paginated) list of documents and subfolders contained within it. When the path matches a document, it returns either its content or, if query parameter details_only is true, its metadata. Use empty string for root folder.

path Parameters
path
required
string

Path to document or folder.

query Parameters
offset
integer
Default: 0

Number of entries to skip.

limit
integer
Default: 100

Maximum number of entries.

Responses

Response samples

Content type
Example
{
  • "is_truncated": true,
  • "entries": [
    ]
}

Uploads a document

Uploads a document or move/copy from an existing document. If the path doesn't exist, it will be automatically created.

path Parameters
path
required
string

Path to document or folder.

Request Body schema:
document
required
string <binary>

Document to upload.

Responses

Request samples

Content type
No sample

Response samples

Content type
application/json
{
  • "result": "string",
  • "hash": "string"
}

Adds metadata or calculates the hash of a document

Adds metadata or calculates and stores the hash of a document. Useful when working with external storage (AWS or Azure) where files may be uploaded through means other than the document store API.

path Parameters
path
required
string

Path to document or folder.

Request Body schema: application/json
metadata
object

Metadata about the document. An object of key/value pairs.

Responses

Request samples

Content type
application/json
{
  • "metadata": { }
}

Response samples

Content type
application/json
Example
{
  • "result": "string",
  • "hash": "string"
}

Uploads a document to overwrite an existing one

Uploads a document or move/copy from an existing document, overwriting the document if it already exists. If the path doesn't exist, it will be automatically created.

path Parameters
path
required
string

Path to document or folder.

Request Body schema:
document
required
string <binary>

Document to upload.

Responses

Request samples

Content type
No sample

Response samples

Content type
application/json
{
  • "result": "string",
  • "hash": "string"
}

Deletes a document.

Deletes a document.

path Parameters
path
required
string

Path to document or folder.

Responses

Response samples

Content type
application/json
{
  • "errorMessage": "string"
}

Transfers

Retrieves the (paginated) document transfer log.

Retrieves the (paginated) document transfer log.

query Parameters
offset
integer
Default: 0

Number of entries to skip.

limit
integer
Default: 100

Maximum number of entries.

Responses

Response samples

Content type
application/json
{
  • "is_truncated": true,
  • "entries": [
    ]
}

Transfers a document.

Transfers a document.

Request Body schema: application/json
from
required
string

Sender destination.

to
required
string

Recepient destination.

document
required
string

Path to document to send.

Responses

Request samples

Content type
application/json
{
  • "from": "string",
  • "to": "string",
  • "document": "string"
}

Response samples

Content type
application/json
{
  • "result": "string",
  • "transfer_id": "string"
}

Search

Searches for documents by name or hash

Searches for documents by name or hash. Result will contain at most 100 entries.

query Parameters
query
required
string

String to search.

by_hash
boolean
Default: false

True to search by hash, false to search by name.

Responses

Response samples

Content type
application/json
{
  • "documents": [
    ],
  • "missing_hashes": true
}

Ensures document hashes

Ensures that every document in storage has its associated hash calculated.

query Parameters
reset
boolean
Default: false

Resets all hashes. Useful for cleaning the internal database when using external storage (AWS or Azure) and documents are deleted through means other than document store API.

Responses

Response samples

Content type
application/json
{
  • "hashes_calculated": 0
}

Preferences

Retrieves preferences values

Retrieves preferences values. (NEW - you may need to upgrade your environment to access this endpoint)

Responses

Response samples

Content type
application/json
{
  • "receivedDocumentsPath": "string",
  • "eventDestinations": [
    ],
  • "eventSenderDestination": "string"
}

Sets preference value

Sets preference value. (NEW - you may need to upgrade your environment to access this endpoint)

Request Body schema: application/json
key
string

Valid preference key - see GET /api/v1/preference for a list of valid preferences

string or Array of arrays or object

Valid value for the given preference key

Responses

Request samples

Content type
application/json
{
  • "key": "string",
  • "value": "string"
}

Response samples

Content type
application/json
{
  • "result": "string"
}