评论
HTTP接口文档
自定义广播接口
POST /comments/api/custom_broadcast
JSON 参数
参数 | 描述 | 取值 | 是否必填 |
---|---|---|---|
actid | 频道HashID | string | 必填 |
content | 消息内容 | string | 必填 |
返回
参数 | 描述 | 取值 |
---|---|---|
errcode | 错误码 | int |
msg | 错误内容 | string |
观众发送评论
POST /comments/api/leave_comment
JSON 参数
参数 | 描述 | 取值 | 是否必填 |
---|---|---|---|
actid | 频道HashID | string | 必填 |
message | 评论消息 | string | 必填 |
name | 评论人名称 | string | 选填 |
avatar | 头像链接 | string | 选填 |
返回
参数 | 描述 | 取值 |
---|---|---|
errcode | 错误码 | int |
msg | 错误内容 | string |
comment_id | 新增评论的id | int |
管理员发送评论 [控制台]
POST /comments/api/admin_leave_comment
JSON 参数
参数 | 描述 | 取值 | 是否必填 |
---|---|---|---|
actid | 频道HashID | string | 必填 |
message | 评论消息 | string | 必填 |
title | 发送者的身份抬头 | string | 选填,默认无身份抬头 |
top | 是否置顶 | bool | 选填,默认不置顶 |
name | 评论人名称 | string | 选填 |
avatar | 头像链接 | string | 选填 |
返回
参数 | 描述 | 取值 |
---|---|---|
errcode | 错误码 | int |
msg | 错误内容 | string |
comment_id | 新增评论的id | int |
观众获取评论列表
GET /comments/api/list_comments
URL 参数
参数 | 描述 | 取值 | 是否必填 |
---|---|---|---|
actid | 频道HashID | string | 必填 |
page | 页码 | int | 选填,默认为1 |
page_size | 每页评论数 | int | 选填,默认为15 |
返回
参数 | 描述 | 取值 |
---|---|---|
errcode | 错误码 | int |
msg | 错误内容 | string |
data | 查询结果 | object |
data.TotalNum | 总评论数 | int |
data.TotalPage | 总页数 | int |
data.PageNum | 当前页码 | int |
data.PageSize | 当前每页评论数 | int |
data.Results | 评论列表 | object array |
data.Results.ID | 评论ID | int |
data.Results.UserID | 评论用户ID | int |
data.Results.Message | 评论内容 | string |
data.Results.Title | 评论用户身份抬头 | string |
data.Results.Name | 评论用户昵称 | string |
data.Results.Avatar | 评论用户头像 | string |
data.Results.LivecommentPushed | 是否发送弹幕 | bool |
data.Results.Top | 是否置顶 | bool |
data.Results.CreateAt | 评论发送时间,例: 2018-08-29 21:41:12 | string |
data.Results.CommentReplies | 该条评论下的回复 | object array |
data.Results.CommentReplies.ID | 回复ID | int |
data.Results.CommentReplies.Message | 回复内容 | string |
data.Results.CommentReplies.Title | 回复用户身份抬头 | string |
data.Results.CommentReplies.Name | 回复用户昵称 | string |
data.Results.CommentReplies.Avatar | 回复用户头像 | string |
data.Results.CommentReplies.Public | 该条回复是否公开 | bool |
data.Results.CommentReplies.CreateAt | 回复时间,例: 2018-08-29 21:41:12 | string |
管理员获取评论列表 [控制台]
GET /comments/api/admin_list_comments
URL 参数
参数 | 描述 | 取值 | 是否必填 |
---|---|---|---|
actid | 频道HashID | string | 必填 |
page | 页码 | int | 选填,默认为1 |
page_size | 每页评论数 | int | 选填,默认为15 |
返回
参数 | 描述 | 取值 |
---|---|---|
errcode | 错误码 | int |
msg | 错误内容 | string |
data | 查询结果 | object |
data.TotalNum | 总评论数 | int |
data.TotalPage | 总页数 | int |
data.PageNum | 当前页码 | int |
data.PageSize | 当前每页评论数 | int |
data.Results | 评论列表 | object array |
data.Results.ID | 评论ID | int |
data.Results.UserID | 评论用户ID | int |
data.Results.Message | 评论内容 | string |
data.Results.Title | 评论用户身份抬头 | string |
data.Results.Name | 评论用户昵称 | string |
data.Results.Avatar | 评论用户头像 | string |
data.Results.LivecommentPushed | 是否发送弹幕 | bool |
data.Results.Top | 是否置顶 | bool |
data.Results.Approved | 是否通过审核 | bool |
data.Results.CreateAt | 评论发送时间,例: 2018-08-29 21:41:12 | string |
data.Results.CommentReplies | 该条评论下的回复 | object array |
data.Results.CommentReplies.ID | 回复ID | int |
data.Results.CommentReplies.Message | 回复内容 | string |
data.Results.CommentReplies.Title | 回复用户身份抬头 | string |
data.Results.CommentReplies.Name | 回复用户昵称 | string |
data.Results.CommentReplies.Avatar | 回复用户头像 | string |
data.Results.CommentReplies.Public | 该条回复是否公开 | bool |
data.Results.CommentReplies.CreateAt | 回复时间,例: 2018-08-29 21:41:12 | string |
审核评论 [控制台]
POST /comments/api/approve_comment
JSON 参数
参数 | 描述 | 取值 | 是否必填 |
---|---|---|---|
actid | 频道HashID | string | 必填 |
id | 评论id | int | 必填 |
返回
参数 | 描述 | 取值 |
---|---|---|
errcode | 错误码 | int |
msg | 错误内容 | string |
推送评论到弹幕 [控制台]
POST /comments/api/push_live_comment
JSON 参数
参数 | 描述 | 取值 | 是否必填 |
---|---|---|---|
actid | 频道HashID | string | 必填 |
id | 评论id | int | 必填 |
返回
参数 | 描述 | 取值 |
---|---|---|
errcode | 错误码 | int |
msg | 错误内容 | string |
设置评论置顶 [控制台]
POST /comments/api/comment_set_top
JSON 参数
参数 | 描述 | 取值 | 是否必填 |
---|---|---|---|
actid | 频道HashID | string | 必填 |
id | 评论id | int | 必填 |
top | 评论是否置顶 | bool | 必填 |
返回
参数 | 描述 | 取值 |
---|---|---|
errcode | 错误码 | int |
msg | 错误内容 | string |
删除评论 [控制台]
POST /comments/api/delete_comment
JSON 参数
参数 | 描述 | 取值 | 是否必填 |
---|---|---|---|
actid | 频道HashID | string | 必填 |
id | 评论id | int | 必填 |
返回
参数 | 描述 | 取值 |
---|---|---|
errcode | 错误码 | int |
msg | 错误内容 | string |
获取评论配置 [控制台]
GET /comments/api/comment_config
URL 参数
参数 | 描述 | 取值 | 是否必填 |
---|---|---|---|
actid | 频道HashID | string | 必填 |
返回
参数 | 描述 | 取值 |
---|---|---|
errcode | 错误码 | int |
msg | 错误内容 | string |
data | 评论配置 | object |
data.ID | 配置ID | int |
data.ActID | 频道ID | int |
data.Open | 是否开启聊天室 | bool |
data.AutoApprove | 是否自动通过审核 | bool |
data.BarrageOpen | 弹幕功能是否开启 | bool |
data.AutoLiveComments | 是否自动发送弹幕 | bool |
data.ShowCommentsNum | 是否显示评论总数 | bool |
更新评论配置 [控制台]
POST /comments/api/update_comment_config
JSON 参数
参数 | 描述 | 取值 | 是否必填 |
---|---|---|---|
actid | 频道HashID | string | 必填 |
open | 是否开启聊天室 | bool | 必填 |
auto_approve | 是否自动通过审核 | bool | 必填 |
barrage_open | 是否开启弹幕功能 | bool | 必填 |
auto_live_comment | 是否自动发送弹幕 | bool | 必填 |
show_comments_num | 是否显示评论总数 | bool | 必填 |
返回
参数 | 描述 | 取值 |
---|---|---|
errcode | 错误码 | int |
msg | 错误内容 | string |
回复一条评论 [控制台]
POST /comments/api/reply_comment
JSON 参数
参数 | 描述 | 取值 | 是否必填 |
---|---|---|---|
actid | 频道HashID | string | 必填 |
comment_id | 被回复的评论ID | int | 必填 |
message | 回复内容 | string | 必填 |
public | 是否公开回复 | bool | 必填 |
title | 回复者的身份抬头 | string | 选填,默认无身份抬头 |
name | 评论人名称 | string | 选填 |
avatar | 头像链接 | string | 选填 |
返回
参数 | 描述 | 取值 |
---|---|---|
errcode | 错误码 | int |
msg | 错误内容 | string |
comment_reply_id | 评论回复ID | int |
删除一条评论回复 [控制台]
POST /comments/api/delete_comment_reply
JSON 参数
参数 | 描述 | 取值 | 是否必填 |
---|---|---|---|
actid | 频道HashID | string | 必填 |
comment_reply_id | 回复ID | int | 必填 |
返回
参数 | 描述 | 取值 |
---|---|---|
errcode | 错误码 | int |
msg | 错误内容 | string |
获取评论导出许可 [控制台]
GET /comments/api/export_token
URL 参数
参数 | 描述 | 取值 | 是否必填 |
---|---|---|---|
actid | 频道HashID | string | 必填 |
返回
参数 | 描述 | 取值 |
---|---|---|
errcode | 错误码 | int |
msg | 错误内容 | string |
token | 评论导出许可,仅可用一次,有效期5分钟 | string |
导出评论和回复 [控制台](新)
GET /comments/api/export_comments
URL 参数
参数 | 描述 | 取值 | 是否必填 |
---|---|---|---|
actid | 频道HashID | string | 必填 |
token | 评论导出许可 | string | 必填 |
返回 .csv 文件
导出评论和回复 [控制台]
GET /comments/api/export_comments_and_replies
URL 参数
参数 | 描述 | 取值 | 是否必填 |
---|---|---|---|
actid | 频道HashID | string | 必填 |
返回 .csv 文件
判断用户是否禁言
GET /comments/api/isin_ban_list
URL 参数
参数 | 描述 | 取值 | 是否必填 |
---|---|---|---|
actid | 频道HashID | string | 必填 |
user_id | 用户id | int | 必填 |
返回
参数 | 描述 | 取值 |
---|---|---|
errcode | 错误码 | int |
msg | 错误内容 | string |
data | 是否被禁言 | bool |
设置/取消禁言接口
POST /comments/api/set_ban_list
JSON 参数
参数 | 描述 | 取值 | 是否必填 |
---|---|---|---|
actid | 频道HashID | string | 必填 |
user_id | 用户id | int | 必填 |
ban | 是否禁言该用户 | bool | 必填 |
返回
参数 | 描述 | 取值 |
---|---|---|
errcode | 错误码 | int |
msg | 错误内容 | string |
禁言列表接口
GET /comments/api/ban_list
URL 参数
参数 | 描述 | 取值 | 是否必填 |
---|---|---|---|
actid | 频道HashID | string | 必填 |
返回
参数 | 描述 | 取值 |
---|---|---|
errcode | 错误码 | int |
msg | 错误内容 | string |
data | 禁言用户列表 | int array |
消息广播
禁言相关消息
Topic: bugu.activity.banlist.{actHashid}
新增禁言用户
{
"Type": "ban_list_add",
"Data": "hubuser_id"
}
解禁用户
{
"Type": "ban_list_remove",
"Data": "hubuser_id"
}
评论相关消息
Topic bugu.activity.comments.{actHashid}
发表评论/审核通过评论
{
"Type": "comment_new",
"Data": ",...评论数据"
}
删除评论
{
"Type": "comment_delete",
"CommentId": comment_id
}
评论回复/删除
{
"Type": "comment_reply_update",
"Data": ",...评论数据"
}
置顶/取消置顶
{
"Type": "comment_top",
"Data": ",...评论数据",
"top": true/false,
}
评论配置修改
{
"Type": "comments_config_update",
"Open": true/false,
"BarrageOpen": true/false,
"ShowCommentsNum": true/false
}
弹幕相关消息
Topic bugu.activity.livecomments.{actHashid}
{
"Text": "content"
}