Skip to content

Operations

Insert

Saves data to selected blockchain network you can later retrieve using select operation.

POST https://api.bws.ninja/v1/call

Request Body

NameTypeValue
solution*stringBWS.Blockchain.Hash
version*number1
network*stringcheck networks
operation*stringinsert
parameters*JSONcheck Method Parameters
json
{
    "statusCode": 200,
    "statusMessage": "",
    "info": {
        "jobId": "59d0f46b-0b58-4972-8aca-51d06f69f25e"
    }
}

Method Parameters

ParameterTypeMax. SizeDesciption
keystringnetwork limitsThe key for your data. You can use this key to select the data using select operation.
valuestringnetwork limitsThe value to save to the selected blockchain

Curl Example

INFO

This operation is asynchronous.
Once executed, check the results using fetch API and the providedjobId.

powershell
curl --location 'https://api.bws.ninja/v1/call' \
--header 'X-Api-Key: API-KEY' \
--header 'Content-Type: application/json' \
--data '{
    "solution": "BWS.Blockchain.Hash",
    "version": 1,
    "network": "matchain",
    "operation": "insert",
    "parameters": {
        "key": "my patient id",
        "value": "my patient data"
    }
}'

Select

Retrieve previously saved data using insert operation.

POST https://api.bws.ninja/v1/call

Request Body

NameTypeDescription
solution*stringBWS.Blockchain.Hash
version*number1
network*stringcheck networks
operation*stringselect
parameters*JSON

check Method Parameters

json
{
    "statusCode": 200,
    "statusMessage": "",
    "info": {
        "jobId": "59d0f46b-0b58-4972-8aca-51d06f69f25e"
    }
}

Method Parameters

ParameterTypeMax. SizeDesciption
keystringnetwork limitsThe hash key you previously used to save data using insert operation.

Curl Example

INFO

This operation is asynchronous.
Once executed, check the results using fetch API and the providedjobId.

powershell
curl --location 'https://api.bws.ninja/v1/call' \
--header 'X-Api-Key: API-KEY' \
--header 'Content-Type: application/json' \
--data '{
    "contract": "Ethereum.Database.Mutable",
    "version": 1,
    "network": "matchain",
    "operation": "select",
    "parameters": {
        "key": "my patient id"
    }
}'