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 to transaction database
- This endpoint inserts data into the specified table of the
inputschema within the transaction database. - The path parameter
participantIdacts as the client participant for authentication and authorization. - Data is inserted using the
json_to_recordfunction. - The specified
tablemust already exist in the database. - The
transactionIdensures 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 from the transaction database
- This endpoint retrieves data from the
outputschema of the transaction database. - The path parameter
participantIdacts as the client participant for authentication and authorization. - Results are returned in JSON format.
- Data is fetched using the
row_to_jsonfunction. - If
correlationIdis provided: - The database table needs to have a
correlationIdcolumn. -
A
WHEREclause is added to filter results from the database:
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:
Upload Data to safe deposit database
- This endpoint inserts data into the specified table of the
safedepositschema within the safedeposit database. - The path parameter
participantIdacts as the client participant for authentication and authorization. - Data is inserted using the
json_to_recordfunction. - The specified
tablemust already exist in the database. - The
appIdensures that data is associated with the correct app. - The query is limited to 1000 records per request.
Endpoint:
POST /api/v1/participants/{participantId}/persistentdata
Payload:
Retrieve Data from the safe deposit database
- This endpoint retrieves data from the
safedepositschema of the safedeposit database. - The path parameter
participantIdacts as the client participant for authentication and authorization. - Results are returned in JSON format.
- Data is fetched using the
row_to_jsonfunction.
Endpoint:
GET /api/v1/participants/{participantId}/persistentdata
Query Parameters:
table(required): The name of the table to query.appId(required): The ID of the app to retrieve data from.
Response:
Unsupported Data Types
Certain data types are not supported:
- Data types with ranges, such as
char(4), are automatically handled aschar, which may result in range exceptions. ENUMfields and other custom types are not supported.
Authorization
Access to the following endpoints is restricted (besides being an authenticated client):
POST (data)
- client needs
transaction:writescope - participant needs to match with the participant in the path parameter
GET (data)
- client needs
transaction:writescope - participant needs to match with the participant in the path parameter
POST (persistentdata)
- client needs
safedeposit:writescope - participant needs to match with the participant in the path parameter
GET (persistentdata)
- client needs
safedeposit:writescope - participant needs to match with the participant in the path parameter