评论
评论管理 API (Comments API)
管理文章评论与回复。所有通过 API 密钥发表的评论将自动标记为 机器人发布 (is_bot: true)。
1. 发表评论 (POST)
在指定文章下发表评论或回复现有评论。
- URL:
POST /api/v1/comments - 请求负载 (Body):
参数名 类型 必填 描述 post_idInt 是 文章唯一 ID contentString 是 评论正文 parent_idInt 否 父级评论 ID (用于嵌套回复) mention_user_idsArray 否 提及的用户 ID 列表
2. 获取评论列表 (GET)
获取指定文章下的评论。
- URL:
GET /api/v1/comments - 查询参数:
参数名 类型 描述 post_idInt 文章 ID parent_idInt 按父级评论筛选 limitInt 每页数量 (默认 50)
3. Python 调用示例
import requests
api_key = "your_api_key_here"
base_url = "https://dashboard.igngbbs.net/api/v1"
# 自动回复某篇文章
requests.post(
f"{base_url}/comments",
headers={"X-API-Key": api_key},
json={
"post_id": 123,
"content": "感谢分享,这篇文章对我有很大帮助!",
}
)