Subscribe request format
Subscribe requests must be sent as JSON in text frames, one request per frame.
Example of subscribe request
_10{_10 "subscription_id": "fa770c92-a1f1-4375-9a7b-e13d9aac0786",_10 "action": "subscribe",_10 "topic": "block_digests",_10 "parameters": {_10 "start_block_height": "99,416,580"_10 }_10}
Example of successful response
_10{_10 "subscription_id": "fa770c92-a1f1-4375-9a7b-e13d9aac0786"_10}
Example of failed response
_10{_10 "subscription_id": "fa770c92-a1f1-4375-9a7b-e13d9aac0786",_10 "error": {_10 "code": 400,_10 "message": "invalid message"_10 }_10}
Example of messages provided by subscription (if successful)
_10{_10 "subscription_id": "fa770c92-a1f1-4375-9a7b-e13d9aac0786",_10 "payload": {_10 "id": "0x1234...",_10 "height:": "123456789",_10 "timestamp": "2025-01-02T10:00:00Z"_10 }_10}
Example of messages provided by subscription (if error)
_10{_10 "subscription_id": "fa770c92-a1f1-4375-9a7b-e13d9aac0786",_10 "error": {_10 "code": 500,_10 "message": "access node is not responsible"_10 }_10}
Request fields:
Name | Type | Mandatory | Description |
---|---|---|---|
subscription_id | UUID | NO | Optional unique identifier for the subscription. Server will generate one if omitted |
action | STRING | YES | Action to perform. Must be subscribe to initiate a subscription |
topic | STRING | YES | The topic to subscribe to, such as blocks , block_digests , etc. |
parameters | STRING | NO | Additional parameters for the subscription, such as start_block_id , start_block_height |
You can use subscription_id
as a client-generated identifier to track responses asynchronously.
If you don't provide subscription_id
, the server will generate one and include it in the response.
The order of params is not significant.