Skip to main content

Updates of securities information

Private resource

The request cannot be executed anonymously. The required token parameter must contain an up-to-date Access Token.

HTTP API

This operation can be performed with request to HTTP API.

Subscription for receiving updates on financial assets on the selected exchange.


Request

To create a subscription to a data channel, send a message to the established WebSocket connection with a request body containing the details of the subscription to be created.

{
"opcode": "InstrumentsGetAndSubscribeV2",
"code": "SBER",
"instrumentGroup": "TQBR",
"exchange": "MOEX",
"instrumentGroup": "TQBR",
"format": "Simple",
"guid": "c328fcf1-e495-408a-a0ed-e20f95d6b813",
"token": "eyJhbGciOiJ..."
}

Responses

The content of the response returned to the WebSocket connection depends on the results of processing the request:

  • If the request is processed successfully, the server will send one 200 code message in response, confirming that the subscription has been created, after which it will begin transmitting 100 code messages containing the information requested as part of the subscription.
  • If the request processing failed, the server will send back one message with an error code corresponding to the reason for the failure, after which it will close the WebSocket connection.

Messages from the channel containing the requested information

The first response from the server contains complete information about the selected asset.

{
"data": {
"symbol": "SBER",
"exchange": "MOEX",
"board": "TQBR",
"tradingStatus": 17,
"tradingStatusInfo": "normal trading period",
"priceMin": 228.78,
"priceMax": 279.96
},
"guid": "c328fcf1-e495-408a-a0ed-e20f95d6b813"
}

The following messages contain only those fields whose value has changed.

{
"data": {
"symbol": "SBER",
"priceMin": 228.78,
"priceMax": 279.96
},
"guid": "c328fcf1-e495-408a-a0ed-e20f95d6b813"
}

It is possible to get the current state of all fields with the /securities request to HTTP API.