Websocket request for the purpose of authorization.
This method authorizes the client after verifying the access token provided.

1. Request

'type' parameter should be 'authorization'.
'token' parameter should be a valid access token from the /token HTTP API.

paramtypedescription
typestring'authorization'
tokenstringaccess_token that you have.
// request

{"type": "authorization", "token": "2DAXR9wApakvhDNQUUr1LWhulWduTkfSZLA7GQL5IRE="}

2. Responses

After successfully authorizing the client, the client gets websocket response
{
type: 'authorization',
result: 'ok'
}

paramtypedescription
typestring'authorization'
resultstring'ok'
//response

{"type":"authorization","result":"ok"}

❗️

INVALID_ARGUMENT Error

already authorized: This client has already been authorized. Authorize request will be ignored.

❗️

UNAUTHORIZED Error

Invalid access token or malformed request. The access token provided is not a valid access token.