Authentication
Authenticate
Must be called before accessing protected subscriptions (position, order, createorder, cancelorder)
Authenticate the WebSocket connection#
Must be called before accessing protected subscriptions (position, order, createorder, cancelorder)
Channel:WEBSOCKET
Tag:
Authentication
MESSAGE
Authenticate the WebSocket connection with JWT token
Parameters
bearerstringJWT authentication token
Payload
{
"jsonrpc": "2.0",
"method": "auth",
"params": {
"bearer": "eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9..."
},
"id": 1
}REPLY
Authentication success response
Parameters
message?stringSuccess message
Payload
{
"jsonrpc": "2.0",
"result": {
"message": "Authenticated successfully"
},
"usIn": 1234567890123,
"usOut": 1234567890456,
"usDiff": 333,
"id": 1
}REPLY
Error response for failed requests
Parameters
jsonrpcstringJSON-RPC version
errorobjectusInintegerRequest received timestamp in milliseconds
usOutintegerResponse sent timestamp in milliseconds
usDiffintegerProcessing time in milliseconds
id?string | integer | nullRequest identifier (if provided in request, otherwise null)
Payload
{
"jsonrpc": "2.0",
"error": {
"code": -32602,
"message": "Invalid subscription params"
},
"usIn": 1234567890123,
"usOut": 1234567890456,
"usDiff": 333,
"id": 2
}