Format

Request Format

{"op":"<operation>", "args":["<topic1>","<topic2>"]}

Terminology

  1. operation: Request action, value:

    Subscribe=subscribe Unsubscribe=unsubscribe Login=login

  2. args: Request parameter, value: channel array or parameters required for login
  3. 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

  4. errorCode: When sending a subscription or login operation generates an error, the error code will be returned

  5. 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>"}

results matching ""

    No results matching ""