---
updatedAt: 2026-09-08T08:45:49.000Z
agentTools:
  projectIndex: https://apidocs.bct.host/llms.txt
---

# Private Channel

Subscribing to private channels requires prior login authentication.

### Login (private channel authentication)

**Authentication process** : establish connection → send login request → wait for response → subscribe to private channel

**Login request** :

```JSON
{
  "op": "login",
  "args": [
    {
      "apiKey": "YOUR_API_KEY",
      "timestamp": "1766124407915",
      "sign": "BASE64_ENCODED_SIGNATURE"
    }
  ]
}
```

**Request parameters** :

| **Parameter** | **Type** | **Explanation**                  |
| ------------- | -------- | -------------------------------- |
| apiKey        | String   | API Key                          |
| timestamp     | String   | Current timestamp (milliseconds) |
| sign          | String   | Signature (Base64 encoding)      |

**Signature generation** :

Signature string: `timestamp + "GET" + "/user/verify" + ""`

1. Use secretKey to encrypt the signature string with HMAC SHA256

2. Base64 encoding the results

**JavaScript example** :

```JavaScript
const crypto = require('crypto');
function generateSign(timestamp, secretKey) {
    const message = timestamp + 'GET' + '/user/verify' + '';
    return crypto.createHmac('sha256', secretKey).update(message).digest('base64');
}
```

**Python example** :

```Python
import hmac, base64

def generate_sign(timestamp, secret_key):
    message = timestamp + 'GET' + '/user/verify' + ''
    signature = hmac.new(bytes(secret_key, 'utf8'), bytes(message, 'utf-8'), digestmod='sha256').digest()
    return base64.b64encode(signature).decode()
```

**Login response** :

```JSON
{"event": "login","code": "0"}
```