Format
Request Format
{"op":"<operation>", "args":["<topic1>","<topic2>"]}
Terminology
- operation: Request action, value:
Subscribe=
subscribe
Unsubscribe=unsubscribe
Login=login
- args: Request parameter, value: channel array or parameters required for login
topic: Channel topic, composed of
<channel>:<filter>
channel is composed of business/name
filter can filter data, refer to the description of each channel for details
Example: spot/ticker: BTC_USDT, which means ticker data of BTC/USDT spot trading pair
errorCode: When sending a subscription or login operation generates an error, the error code will be returned
- errorMessage: When an error occurs when sending a subscription or a login operation, the error message will be returned
Successful Response Format
When return data does not contain the error_code field, it indicates success
When op=login:
{"event":"<operation>"}
When op=unsubscribe:
{"event":"<operation>","topic":"<topic>"}
When op=subscribe:
{"table":"<topic1>","data":"[{"<value1>","<value2>"}]"}
{"table":"<topic2>","data":"[{"<value1>","<value2>"}]"}
Failed Response Format
If the error_code field is returned, it means failure. For the reason of failure, please refer to: WebSocket error code
{"event":"<operation>","errorMessage":"<error_message>","errorCode":"<error_code>"}