Grid Daemon REST API (0.3.1)

Download OpenAPI specification:Download

A REST API providing HTTP/JSON interface to Grid.

Transaction

Submits a list of transaction batches to the distributed ledger

This endpoint can be used to submit batches to the underlying distributed ledger. The operation called by this endpoint will depend on which distributed ledger is supporting this deployment of Grid. Regardless of the underlying ledger, the body of this request must be a valid list of Sabre batches.

If the Grid Daemon is running against a Sawtooth distributed ledger, then the batches are forwarded to the /batches endpoint of the Sawtooth REST API.

If the Grid Daemon is running against Splinter, then the service_id query parameter is required for this request. The Grid Daemon will use the service ID to forward the transaction to an endpoint on the Splinter Daemon for the Scabbard service corresponding to the provided service ID.

The API will return immediately with a status of 202. There will be no data object, only a link to a /batch_statuses endpoint to be polled to check the status of submitted batches.

query Parameters
service_id
string

The ID of the service the request should be sent to. This parameter is required if running on Splinter.

Format: <circuit-id>::<service-id>

wait
integer

The number of seconds to wait for batches to be committed before returning.

Request Body schema: application/octet-stream

A binary encoded protobuf BatchList

Array of objects (Batch)

Responses

Fetches the committed statuses for a set of batches

Fetches an array of objects with a status and id for each batch requested. There are four possible statuses with string values 'COMMITTED', 'INVALID', 'PENDING', and 'UNKNOWN'.

The batch(es) you want to check can be specified using the id filter parameter. If a wait time is specified in the URL, the API will wait to respond until all batches are committed, or the time in seconds has elapsed. If the value of wait is not set (i.e., ?wait&id=...), or it is set to any non-integer value other than false, the wait time will be just under the API's specified timeout (usually 300).

Note that because this route does not return full resources, the response will not be paginated, and there will be no head or paging properties.

query Parameters
id
required
string

A comma-separated list of batch IDs

wait
integer

The number of seconds to wait for batches to be committed before returning.

service_id
string

The ID of the service the request should be sent to. This parameter is required if running on Splinter.

Format: <circuit-id>::<service-id>

Responses

Response samples

Content type
application/json
[]

Location

Lists all locations

query Parameters
service_id
string

The ID of the service the request should be sent to. This parameter is required if running on Splinter.

Format: <circuit-id>::<service-id>

offset
integer

The index of the first element to be in the page

limit
integer

The maximum number of elements in a page

Responses

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "paging": {
    }
}

Fetches a single location with the given ID

path Parameters
location_id
required
string

ID of the location to fetch

query Parameters
service_id
string

The ID of the service the request should be sent to. This parameter is required if running on Splinter.

Format: <circuit-id>::<service-id>

Responses

Response samples

Content type
application/json
{
  • "location_id": 99474000005,
  • "location_namespace": "UNSET_NAMESPACE",
  • "owner": "02cd3181dbd7d1539f470436ce222c53ab5e514f67809dc0095895e6cdfba97612",
  • "properties": [
    ],
  • "service_id": "12345-QWERTY:gsAA"
}

Pike

Lists all agents

query Parameters
service_id
string

The ID of the service the request should be sent to. This parameter is required if running on Splinter.

Format: <circuit-id>::<service-id>

offset
integer

The index of the first element to be in the page

limit
integer

The maximum number of elements in a page

Responses

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "paging": {
    }
}

Fetches an agent with the given public key

path Parameters
public_key
required
string

Public key of the agent to fetch

query Parameters
service_id
string

The ID of the service the request should be sent to. This parameter is required if running on Splinter.

Format: <circuit-id>::<service-id>

Responses

Response samples

Content type
application/json
{
  • "public_key": "038bba5708acc262464c9fe30d3de9e905a9a5fa30cedd151dd9cd09ea26d46d00",
  • "org_id": 13600,
  • "active": "true",
  • "roles": [
    ],
  • "metadata": [
    ],
  • "service_id": "12345-QWERTY:gsAA"
}

Lists all organizations

query Parameters
service_id
string

The ID of the service the request should be sent to. This parameter is required if running on Splinter.

Format: <circuit-id>::<service-id>

offset
integer

The index of the first element to be in the page

limit
integer

The maximum number of elements in a page

Responses

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "paging": {
    }
}

Fetches a single organization with the given ID

path Parameters
id
required
string

ID of the organization to fetch

query Parameters
service_id
string

The ID of the service the request should be sent to. This parameter is required if running on Splinter.

Format: <circuit-id>::<service-id>

Responses

Response samples

Content type
application/json
{
  • "id": "philips001",
  • "name": "Philips",
  • "locations": [
    ],
  • "alternate_ids": [
    ],
  • "metadata": [
    ],
  • "service_id": "12345-QWERTY:gsAA"
}

Lists all roles for a single organization

path Parameters
org_id
required
string

Org ID of the organization to list roles for

query Parameters
service_id
string

The ID of the service the request should be sent to. This parameter is required if running on Splinter.

Format: <circuit-id>::<service-id>

offset
integer

The index of the first element to be in the page

limit
integer

The maximum number of elements in a page

Responses

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "paging": {
    }
}

Fetches a role for a single organization

path Parameters
org_id
required
string

Org ID of the organization that the role belongs to

name
required
string

Name of the role to fetch

query Parameters
service_id
string

The ID of the service the request should be sent to. This parameter is required if running on Splinter.

Format: <circuit-id>::<service-id>

Responses

Response samples

Content type
application/json
{
  • "name": "alpha.Drivers",
  • "org_id": 314156,
  • "permissions": [
    ],
  • "allowed_organizations": [
    ],
  • "super_roles": [
    ],
  • "inherit_from": [
    ]
}

Product

Lists all products

query Parameters
service_id
string

The ID of the service the request should be sent to. This parameter is required if running on Splinter.

Format: <circuit-id>::<service-id>

offset
integer

The index of the first element to be in the page

limit
integer

The maximum number of elements in a page

Responses

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "paging": {
    }
}

Fetches a single product with the given ID

path Parameters
product_id
required
string

ID of the product to fetch

query Parameters
service_id
string

The ID of the service the request should be sent to. This parameter is required if running on Splinter.

Format: <circuit-id>::<service-id>

Responses

Response samples

Content type
application/json
{
  • "product_id": 122765988220,
  • "product_address": "621dee0201000000000000000000000000000000000000000000000012276598822000",
  • "product_namespace": "UNSET_NAMESPACE",
  • "owner": "02cd3181dbd7d1539f470436ce222c53ab5e514f67809dc0095895e6cdfba97612",
  • "properties": [
    ],
  • "service_id": "12345-QWERTY:gsAA"
}

Schema

Lists all schemas

query Parameters
service_id
string

The ID of the service the request should be sent to. This parameter is required if running on Splinter.

Format: <circuit-id>::<service-id>

offset
integer

The index of the first element to be in the page

limit
integer

The maximum number of elements in a page

Responses

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "paging": {
    }
}

Fetches a single schema with the given name

path Parameters
schema_name
required
string

Name of the schema to fetch

query Parameters
service_id
string

The ID of the service the request should be sent to. This parameter is required if running on Splinter.

Format: <circuit-id>::<service-id>

Responses

Response samples

Content type
application/json
{
  • "name": "Lightbulb",
  • "description": "Example Lightbulb schema",
  • "owner": "philips001",
  • "properties": [
    ],
  • "service_id": "12345-QWERTY:gsAA"
}

Track and Trace (Experimental)

Fetches a list of records, including lists of all updates made to the owner and custodian

query Parameters
service_id
string

The ID of the service the request should be sent to. This parameter is required if running on Splinter.

Format: <circuit-id>::<service-id>

offset
integer

The index of the first element to be in the page

limit
integer

The maximum number of elements in a page

Responses

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "paging": {
    }
}

Fetches a single record with the given ID

Fetches a single record with the given record ID

path Parameters
record_id
required
string

ID of the record to fetch

query Parameters
service_id
string

The ID of the service the request should be sent to. This parameter is required if running on Splinter.

Format: <circuit-id>::<service-id>

Responses

Response samples

Content type
application/json
{
  • "record_id": "7h15-45537-15-br173",
  • "schema": "Lightbulb",
  • "owner": "02cd3181dbd7d1539f470436ce222c53ab5e514f67809dc0095895e6cdfba97612",
  • "custodian": "02fb5b3a093e20e420ecf9c5839215e74c97f49eb51889069eb87bc6f62ceca8dd",
  • "properties": [
    ],
  • "proposals": [
    ],
  • "owner_updates": [
    ],
  • "custodian_updates": [
    ],
  • "final": true,
  • "service_id": "12345-QWERTY:gsAA"
}

Fetches a property with the given name from the record with the specified ID

path Parameters
record_id
required
string

ID of the record to fetch a property from

property_name
required
string

Name of the property to fetch

query Parameters
service_id
string

The ID of the service the request should be sent to. This parameter is required if running on Splinter.

Format: <circuit-id>::<service-id>

Responses

Response samples

Content type
application/json
{
  • "name": "location",
  • "record_id": "7h15-45537-15-br173",
  • "data_type": "BYTES",
  • "authorized_reporters": [
    ],
  • "value": {
    },
  • "updates": [
    ],
  • "service_id": "12345-QWERTY:gsAA"
}