# 企业管理员指派,群发消息给客户

# 操作流程

  1. 通过企微后台给机器人分配群发消息给客户任务
  2. 机器人接收到705012事件
  3. 调用接口,让机器人执行群发任务(入参需要705012中的msg_id)

# 注意事项

  • 创建群发任务时,消息内容为空,接收事件时将无法辨别具体对应哪一个群发任务
  • 执行时需要按企业级别间隔2-3分钟/次以上为佳

# 企业管理员指派任务事件

encoding_content解密后的结构

{
    "event_type": 705012,
    "err_code": 0,
    "err_msg": "",
    "robot_id": "机器人id",
    "data": {
        "msg_time": "消息时间",
        "msg_id": "消息Id",
        "content": "群发内容",
	    "admin_name": "管理员名称"
    }
}

说明

字段 类型 说明
event_type int 事件类型,705012
errcode int 错误码
errmsg string 错误描述
robot_id string 机器人id
msg_time string 消息时间
msg_id string 消息Id
content string 群发内容
admin_name bool 管理员名称

# 机器人执行群发任务

请求方式:POST

请求地址:https://$basehost/gateway/qopen/SendTaskBroadcastMessage

body参数

{
    "robot_id": "机器人id",
    "msg_id": "705012事件中的msg_id"
}
字段 类型 必填 说明
robot_id int 机器人id
msg_id int 705012事件中的msg_id

返回值:

{
    "errcode": 0,
    "errmsg": "",
    "data": {
    }
}
字段 类型 说明
errcode int 错误码
errmsg string 错误描述

完整请求示例:

curl -X POST \
  https://$basehost/gateway/qopen/SendTaskBroadcastMessage \
  -H 'Content-Type: application/json; charset=UTF-8' \
  -H 'Token: c2NdxDHKXIJ5j1zrhJeq2eJEHjh9xxx' \
  -d '{
  	    "robot_id": "机器人id",
    "msg_id": "705012事件中的msg_id"
  }'

处理结果,异步返回值:

{
    "event_type": 705013,
    "err_code": 0,
    "err_msg": "",
    "robot_id": "机器人id",
	"data": {
    }
}
字段 类型 说明
event_type int 事件类型,705013
err_code int 状态码,0为正常,非0代表错误
err_msg string 错误信息
robot_id string 机器人id
最后更新时间: 2024/4/19 11:10:27