# 創建討論回覆

`POST` `/v1/content/topics/{topic_id}/comments`

在指定討論下發布回覆，支持嵌套回覆已有回覆。完整社區討論可瀏覽 [社區](https://longbridge.com/topics)。

僅限 **[Longbridge 開戶](https://longbridge.com/hk/download) 且持有資產** 的用戶才允許通過 Longbridge Developers 的 API 或 CLI 發布社區討論和回覆。否則返回 `403`。

**正文格式：** 僅支持純文本，不支持 HTML 或 Markdown。

:::tip Tip
正文中提到的標的代碼（如 `700.HK`、`TSLA.US`）會被平台自動識別並關聯為相關標的。

⚠️ 請勿濫用此功能關聯與內容無關的標的，否則後台內容運營可能會限制發布，甚至有可能禁言。
:::

**頻率限制：** 同一用戶在同一討論下，前 3 條無間隔限制；此後每條須與上一條保持遞增間隔（3 s → 5 s → 8 s → 13 s → 21 s → 34 s → 55 s 封頂），超出限制返回 `429`。

:::warning
⚠️ 以上頻率限制規則僅供參考，平台可能隨時進行內部調整。
:::

## Parameters

### Path Parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `topic_id` | string | Yes | 討論 ID，如 `6993508780031016960` |

### Request Body

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `body` | string | Yes | 回覆正文，僅支持純文本。正文中提到的標的代碼會被平台自動識別並關聯。 |
| `reply_to_id` | string | No | 被回覆的回覆 ID；不填或填 `"0"` 表示發頂層回覆，填入有效 ID 則嵌套在該回覆下。 |

## Request Example

```bash
curl --request POST \
  --url 'https://openapi.longbridge.com/v1/content/topics/<topic_id>/comments' \
  --header 'Authorization: Bearer <access_token>' \
  --header 'Content-Type: application/json' \
  --data '{"body":"<body>","reply_to_id":"<reply_to_id>"}'
```

## Response

### Response Properties

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `item` | object | Yes | 新建回覆詳情 |
| `└ id` | string | Yes | 回覆 ID |
| `└ topic_id` | string | Yes | 所屬討論 ID |
| `└ body` | string | No | 回覆正文（純文本） |
| `└ reply_to_id` | string | No | 父回覆 ID，`"0"` 表示頂層回覆 |
| `└ author` | object | No | 作者信息 |
| `└ ∟ member_id` | string | No | 作者 member ID |
| `└ ∟ name` | string | No | 作者暱稱 |
| `└ ∟ avatar` | string | No | 作者頭像 URL |
| `└ images` | object[] | No | 附圖列表 |
| `└ ∟ url` | string | No | 原始圖片 URL |
| `└ ∟ sm` | string | No | 小縮略圖 URL |
| `└ ∟ lg` | string | No | 大縮略圖 URL |
| `└ likes_count` | int32 | No | 點讚數 |
| `└ comments_count` | int32 | No | 嵌套回覆數 |
| `└ created_at` | string | Yes | 創建時間，Unix 時間戳（秒） |

### Response JSON Example

```json
{
  "code": 0,
  "message": "success",
  "data": {
    "item": {
      "id": "7001234567890123460",
      "topic_id": "6993508780031016960",
      "body": "Great analysis!",
      "reply_to_id": "0",
      "author": {
        "member_id": "10086",
        "name": "Jane Doe",
        "avatar": "https://example.com/avatar.jpg"
      },
      "images": [],
      "likes_count": 0,
      "comments_count": 0,
      "created_at": "1742002000"
    }
  }
}
```
