该接口可向单用户发送助手消息(**最新代码计划12月底发布**) > http://{app域名}/mag/operative/v1/assistant/sendAssistantMsg?user_id=5&type=text&content={"type":"text","content":"纯文本消息内容"}&assistant_secret=056f5ba18cdbca8dae973ade25866eda&secret=yKSfbbEte2d8cWTaJ8q5X1zXarKXtxMG9&is_push=0 > #### 参数说明 | 名称 |类型|说明 | | --- | -- |--- | | user_id|int |接收消息的用户id | | type|string|消息类型 (multipic:多图文,singlepic:单图文,pictemp:有图模板,texttemp:无图模板,text:文本消息,onlypic:纯图片消息,remind:提醒) | | content|string |消息内容(json字符串) ,content需要urlencode| | assistant_secret|string |社区助手secret。如果为空,则使用系统助手(默认客服)进行发送| | secret|string |后台设置的secret密钥 | | is_push|int |是否推送给用户(0:否 1:是) | #### 参数content各类型json格式 参数content需要按照以下json格式进行传递 ~~~ multipic:多图文 { "tag": "多图文消息", "title":"标题", "cover_url":"http://cdn.oss.magapp.magcloud.cc/pic/20171121/oss_1511250886770_747_633_920.png", "link":"http://magapp.cc", "items":[ { "text":"标题", "pic_url":"http://image/图片.png", "link":"http://magapp.cc" }, { "text":"标题", "pic_url":"http://image/图片.png", "link":"http://magapp.cc" } ] } singlepic:单图文 { "tag": "单图文消息", "title":"标题", "cover_url":"http://image/图片.png", "link":"http://magapp.cc", "extra_info":[ { "key":"说明标题1", "val":"说明内容1" }, { "key":"说明标题2", "val":"说明内容2" } ] } pictemp:有图模板 { "tag":"标题", "title":"内容标题", "pic_url":"http://image/图片.png", "link":"http://magapp.cc/", "extra_info":[ { "key":"内容说明", "val":"内容说明项目" }, { "key":"内容说明2", "val":"内容说明项目2" } ], "des":"备注描述", "des_themecolor":"#ff0000" } texttemp:无图模板 { "tag":"标题", "title":"内容标题", "title_themecolor":"#ff0000", "link":"http://magapp.cc/", "extra_info":[ { "key":"内容说明项目1", "val":"说明内容" }, { "key":"内容说明项目2", "val":"说明内容" } ], "des":"备注描述", "des_themecolor":"#ff8040" } text:文本消息 { "type":"text", "content":"纯文本消息内容" } onlypic:纯图片消息 { "type":"pic", "content":"http://image/图片.png" } remind:提醒类消息 { "tag": "付款成功提醒", "title": "付款金额", "subtitle": "¥20", "link":"http://magapp.cc", "extra_info":[ { "key":"消费类型", "val":"商城购物" }, { "key":"支付类型", "val":"钱包支付" } ] } 部分模板内容会有des_themecolor字段,可以自定义该段文字的颜色 ~~~ #### 发送成功返回实例 ~~~ { success: true, code: 101, msg: "" } ~~~ #### 发送失败返回实例 ~~~ { success: false, code: "10001", msg: "接收用户ID不可为空" } ~~~