Skip to main content

Unsubscribe

Private resource

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

The request cancels a previously created subscription to a data feed. The canceled subscription can be specified by the value of the guid parameter. The subscription should be canceled in the same WebSocket connection where it was created.


Request

To cancel a previously created subscription, send a message with a request body containing its identifier to the WebSocket connection where the subscription was created.

{
"opcode": "unsubscribe",
"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 terminated.
  • 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.

Successful request processing report. A response with this code is returned if the server successfully processes the request, regardless of whether a subscription with the specified guid is found within the WebSocket connection.

{
"message": "Handled successfully",
"httpCode": 200,
"requestGuid": "c328fcf1-e495-408a-a0ed-e20f95d6b813"
}