# 创建讨论回复

`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"
    }
  }
}
```
