Skip to main content

Authorize connection

Authorization

This request should be executed first after establishing a WebSocket connection and repeated periodically to update the Access token in use.

The request authorizes the established WebSocket connection, within which all further requests for order management will be executed. Each new connection with /cws interface should be authorized separately.

Authorization is not timeless - requests executed within an authorized connection are considered authorized within the validity period of the Access token (30 minutes from creation). When this period expires, you will need to repeat the request with a new token to continue your work.


Request

Authorization details

Authorized access to WebSocket API is provided only within the WebSocket connection in which the request was executed. For each new WebSocket connection authorization must be performed separately.

To authorize the connection and all further commands executed within it, run the request with the actual Access token as the value of the token parameter.

{
"opcode": "authorize",
"guid": "c328fcf1-e495-408a-a0ed-e20f95d6b813",
"token": "eyJhbGciOiJ..."
}

Responses

According to the results of processing the received request, the server will return a message with the corresponding code to the WebSocket connection.

Successful request processing report

{
"requestGuid": "c328fcf1-e495-408a-a0ed-e20f95d6b813",
"httpCode": 200,
"message": "The connection has been initialized."
}