Exchange WebSocket Authentication #
The following WebSocket feeds require authentication:
- Full channel
- User channel
- Level2 channel
- Level3 channel
To authenticate, send a subscribe
message and pass in fields to GET /users/self/verify
, just as if you were signing a request. To get the necessary parameters, go through the same process as you would to make authenticated calls to the API.
CAUTION
Authenticated feed messages do not increment the sequence number, which means that it is currently not possible to detect if an authenticated feed message was dropped.
Examples #
// Authenticated feed messages add user_id and
// profile_id for messages related to your user
{
"type": "open", // "received" | "open" | "done" | "match" | "change" | "activate"
"user_id": "3452rttrf8g293d0238j8023",
"profile_id": "543w8273-e9823-2393-5de3-gf2s42ds2354",
/* ... */
}
Here’s an example of an authenticated subscribe
request:
// Request
{
"type": "subscribe",
"product_ids": [
"hBTC-USD"
],
"channels": [
"full"
],
"signature": "...",
"key": "...",
"passphrase": "...",
"timestamp": "..."
}
Benefits #
HootDex recommends that you authenticate all WebSocket channels, but only those listed above are enforced. You can authenticate yourself when subscribing to the WebSocket Feed. The benefits of authenticating are:
- Messages (in which you are of the parties) are expanded and have more useful fields.
- You receive private messages, such as lifecycle information about stop orders you placed.