# 发送系统消息
请求方式:POST
请求地址:https://$basehost/gateway/eaopen/SendSystemMsg
body参数:
{
"customer_service_account_list":["xxx","xxxx"] , //客服账号列表,非必填
"robot_id_list":["xxx","xxxx"], //机器人id列表,非必填 但是客服账号列表和机器人id列表必填一个
"msg_title":"xxxxx", //消息标题 必填
"msg_content":"xxxxxx", //消息内容,必填
"text_desc": {
"session_url_list": [{
"robot_id": "xxxxxxxxxxxxxx",
"account_id": "xxxxxxxxxxxxxx",
"content": "xxxxxxxxxxxxxx"
},
{
"robot_id": "xxxxxxxxxxxxxx",
"account_id": "xxxxxxxxxxxxxx",
"content": "xxxxxxxxxxxxxx"
}
],
"external_link_list":[{
"text":"xxxxxxxxxxxxxx",
"link":"xxxxxxxxxxxxxx"
},
{
"text":"xxxxxxxxxxxxxx",
"link":"xxxxxxxxxxxxxx"
}
]
}
}
字段 | 类型 | 必填 | 说明 |
---|---|---|---|
customer_service_account_list | array | 否 | 客服账号列表(客服账号列表和机器人id列表必填一个) |
robot_id_list | array | 否 | 机器人id列表 (客服账号列表和机器人id列表必填一个) |
msg_title | string | 是 | 消息标题 |
msg_content | string | 是 | 消息内容 |
text_desc | object | 否 | 文本内容 |
session_url_list | array | 否 | 会话超链接列表 |
robot_id | string | 是 | 机器人id |
account_id | string | 是 | 客户id |
content | string | 是 | 对话超链内容 |
external_link_list | array | 否 | 外部链接列表 |
text | string | 是 | 外部链接文本 |
link | string | 是 | 外部链接值 |
invalid_session_list | string | 是 | 无效会话列表 |
返回值:
{
"data": {
"success_list": [
{
"customer_service_account": "xxxxxxxxxxxxx"
}
],
"fail_list": [
{
"customer_service_account": "xxxxx", //客服3,
"robot_id": "xxxxx", //机器人3,
"fail_reason": "机器人xxxx不存在"
}
],
"invalid_session_list": [
"机器人id: xxxxxx 的会话无效 "
]
},
"errcode": 0,
"errmsg": "",
"hint": "xxxxxxxxxx"
}
完整请求示例:
curl -X POST \
https://$basehost/gateway/eaopen/SendSystemMsg \
-H 'Content-Type: application/json; charset=UTF-8' \
-H 'Token: c2NdxDHKXIJ5j1zrhJeq2eJEHjh9xxx' \
-d '{
"customer_service_account_list":["xxx","xxxx"] , //客服账号列表,非必填
"robot_id_list":["xxx","xxxx"], //机器人id列表,非必填 但是客服账号列表和机器人id列表必填一个
"msg_title":"xxxxx", //消息标题 必填
"msg_content":"xxxxxx", //消息内容,必填
"text_desc": {
"session_url_list": [{
"robot_id": "xxxxxxxxxxxxxx",
"account_id": "xxxxxxxxxxxxxx",
"content": "xxxxxxxxxxxxxx"
},
{
"robot_id": "xxxxxxxxxxxxxx",
"account_id": "xxxxxxxxxxxxxx",
"content": "xxxxxxxxxxxxxx"
}
],
"external_link_list":[{
"text":"xxxxxxxxxxxxxx",
"link":"xxxxxxxxxxxxxx"
},
{
"text":"xxxxxxxxxxxxxx",
"link":"xxxxxxxxxxxxxx"
}
]
}
}'
← 消息类型说明 新群聊 - 20002 →