发送消息更新时间:2020-10-26 09:49:18
发送消息
API 地址
api.vhallyun.com/api/v2/message/send
描述
通过频道作为载体,可根据类型发送消息
入参
关于公共请求参数详细内容,请参考 公共请求参数。
| 参数 |
类型 |
是否必选 |
含义 |
| channel_id |
string |
是 |
频道ID |
| type |
string |
是 |
消息类型 |
| body |
string |
是 |
消息体(编码:utf8) |
| client |
string |
否 |
客户端 |
| room_id |
string |
否 |
直播房间ID |
| third_party_user_id |
string |
否 |
第三方用户ID,type为service_im时必填 |
| no_audit |
int |
否 |
是否经过智能审核,0经过,1不经过,默认为0 |
| context |
json String |
否 |
自定义内容,须包含nick_name及avatar字段 |
type枚举值列表
| 枚举值 |
说明 |
| service_im |
聊天消息 |
| service_custom |
自定义消息 |
client枚举值列表
当type为service_im时必填
| 枚举值 |
说明 |
| pc_browser |
PC网页浏览器 |
| h5_browser |
h5网页浏览器 |
| android |
安卓手机应用 |
| ios |
苹果手机应用 |
| desktop |
桌面客户端 |
| wechat_browser |
微信内置浏览器 |
| wechat_applet |
微信小程序 |
出参
错误码
| 错误码 |
类型 |
含义 |
| 10006 |
int |
第三方用户ID不能为空 |
| 10010 |
int |
消息类型不能为空 |
| 10016 |
int |
频道ID不能为空 |
| 20002 |
int |
房间查询为空 |
| 20004 |
int |
频道查询为空 |
| 30002 |
int |
不是当前频道拥有者 |
| 30011 |
int |
当前自定义广播过量,无法继续发送,每个频道限制1000条每分钟 |
| 40002 |
int |
消息类型不正确 |
| 40004 |
int |
消息体过长,最长为2000 |
| 40013 |
int |
客户端类型不能为空 |
| 40014 |
int |
客户端类型错误 |
| 50002 |
int |
消息发送失败 |
| 50028 |
int |
消息发送失败,频道已被禁言! |
| 50029 |
int |
消息发送失败,用户已被禁言! |
响应格式
{
"code": 200,
"msg": null,
"data": []
}