Skip to content

Data Management API

The Data Management API allows participants to upload and retrieve data associated with transactions and the safe deposit database.

Endpoints

Upload Data

  • This endpoint inserts data into the specified table within the transaction database.
  • The path parameter participantId acts as the client selector for authentication and authorization.
  • Data is inserted using the json_to_record function.
  • The specified table must already exist in the database.
  • The transactionId ensures that data is associated with the correct transaction.
  • The query is limited to 1000 records per request.

Endpoint:
POST /api/v1/participants/{participantId}/data

Payload:

{
  "data": [
      "{\"key1\":\"value1\",\"key2\":\"value2\"}"
  ],
  "table": "string",
  "transactionId": "string"
}

Retrieve Data

  • This endpoint retrieves data from the output schema of the transaction database.
  • Results are returned in JSON format.
  • Data is fetched using the row_to_json function.
  • If correlationId is provided:
    • The database table needs to have a correlationId column.
    • A WHERE clause is added to filter results from the database:
      WHERE correlationId = {correlationId}
      

Endpoint:
GET /api/v1/participants/{participantId}/data

Query Parameters:

  • table (required): The name of the table to query.
  • transactionId (required): The ID of the transaction to retrieve data from.
  • correlationId (optional): Filters results by correlation ID if provided.

Response:

[
  "{\"key1\":\"value1\",\"key2\":\"value2\"}",
  "{\"key1\":\"value3\",\"key2\":\"value4\"}"
]

Unsupported Data Types

Certain data types are not supported:

  • Data types with ranges, such as char(4), are automatically handled as char, which may result in range exceptions.
  • ENUM fields and other custom types are not supported.

Security and Authorization

  • The participantId in the path ensures that only authorized participants can access or modify the respective data. It needs to match the clientSelector provided in the client registration
  • Connections are established dynamically using credentials retrieved from the credential service.