Appearance
发送消息
POST /agent/message/send
以当前登录客服身份向访客发送消息。服务端会保存消息并向客服、访客两端广播 message.created。
请求参数
| 字段 | 位置 | 类型 | 必填 | 用途 |
|---|---|---|---|---|
to | body | string | 是 | 访客 UID。 |
content | body | string | 是 | 消息正文,不能为空。 |
tmp_mid | body | string | number | 否 | 客户端临时消息 ID。 |
uniqueId | body | string | number | 否 | 客户端关联标识,随实时事件透传。 |
成功响应
json
{
"code": 0,
"msg": "ok",
"data": {
"mid": 1024,
"e": null
}
}| 字段 | 类型 | 用途 |
|---|---|---|
data.mid | number | 新建消息的服务端 ID。 |
data.e | mixed | 渠道扩展发送结果;普通 Web 访客通常为 null。 |
当前客服启用翻译且访客语言需要翻译时,访客还会收到 message.translated 事件。