文档
测试

req- [异步] -发送会话消息

POST
http://{url}/api/Robot/ModifyProfileName

接口描述

发送会话消息

请求头

参数名
类型
描述
Content-Type
String
application/json

请求参数

参数名
类型
描述
vcMerchantNo
String
供应商ID
vcRobotSerialNo
Long
微信号UIN
vcRelaSerialNo
String
消息关联ID
vcChatRoomSerialNo
String
消息接收者的wxid
Data
List<Object>
消息内容
nMsgNum
Integer
消息总条数
nMsgType
Integer
消息类型 (具体请查看下文枚举值说明)
msgContent
String
内容
nVoiceTime
Integer
语音时常 (默认0)
vcTitle
String
标题
vcDesc
String
描述
vcHref
String
消息链接
vcAtWxSerialNos
List<String>
@微信号的wxid

nMsgType 枚举值说明

|nMsgType|字段含义说明| |-|-| |2001|文本| |2002|图片| |2003|语音| |2004|视频| |2005|图文链接| |2008|发送gif图片| |2013|小程序|

请求示例

**发送文本** ``` { "vcMerchantNo": "{{appId}}", "vcRobotSerialNo": {{uin}}, "vcRelaSerialNo": "{{msgid}}", "vcChatRoomSerialNo": "{{userName}}", "Data": [{ "nMsgNum": 1, "nMsgType": 2001, "msgContent": "hello-test", "nVoiceTime": 0, "vcTitle": "", "vcDesc": "", "vcHref": "", "vcAtWxSerialNos":[""] }] } ``` @好友示例: ``` { "vcMerchantNo": "{{appId}}", "vcRobotSerialNo": {{uin}}, "vcRelaSerialNo": "{{msgid}}", "vcChatRoomSerialNo": "{{userName}}", "Data": [{ "nMsgNum": 1, "nMsgType": 2001, "msgContent": "hello@小琳", "nVoiceTime": 0, "vcTitle": "", "vcDesc": "", "vcHref": "", "vcAtWxSerialNos":["wxid_15s48dvw9f7s22"] }] } ``` --- **发送图片** ``` { "vcMerchantNo": "{{appId}}", "vcRobotSerialNo": {{uin}}, "vcRelaSerialNo": "{{msgid}}", "vcChatRoomSerialNo": "{{userName}}", "Data": [{ "nMsgNum": 1, "nMsgType": 2002, "msgContent": "https://wx.qlogo.cn/mmhead/ver_1/cUQCMiauQnCQrpOOdttRYElBiauERPUb6OfeHKxuTyypo989hae15NWbKyTGuPSCzMGJrZvOhkyI8s1b2ulMQ7TK0w8SB2UODvAcxKiajQ5Lmw/0", "nVoiceTime": 0, "vcTitle": "", "vcDesc": "", "vcHref": "", "vcAtWxSerialNos":[""] }] } ``` --- **发送语音** ``` { "vcMerchantNo": "{{appId}}", "vcRobotSerialNo": {{uin}}, "vcRelaSerialNo": "{{msgid}}", "vcChatRoomSerialNo": "{{userName}}", "Data": [{ "nMsgNum": 1, "nMsgType": 2003, "msgContent": "https://lianluoyi.oss-cn-shenzhen.aliyuncs.com/upload/material/1733657e9db0fb75805f9af400a894e5.silk", "nVoiceTime": 10, "vcTitle": "", "vcDesc": "", "vcHref": "", "vcAtWxSerialNos":[""] }] } ``` **发送图文链接** ``` { "vcMerchantNo": "{{appId}}", "vcRobotSerialNo": {{uin}}, "vcRelaSerialNo": "{{msgid}}", "vcChatRoomSerialNo": "{{userName}}", "Data": [{ "nMsgNum": 1, "nMsgType": 2005, "msgContent": "https://wx.qlogo.cn/mmhead/ver_1/cUQCMiauQnCQrpOOdttRYElBiauERPUb6OfeHKxuTyypo989hae15NWbKyTGuPSCzMGJrZvOhkyI8s1b2ulMQ7TK0w8SB2UODvAcxKiajQ5Lmw/0", "nVoiceTime": 0, "vcTitle": "标题", "vcDesc": "描述", "vcHref": "https://www.notion.so/6bd959adfa434dedbffa1aaea6d53db7", "vcAtWxSerialNos":[""] }] } ``` --- **发送视频** ``` { "vcMerchantNo": "{{appId}}", "vcRobotSerialNo": {{uin}}, "vcRelaSerialNo": "{{msgid}}", "vcChatRoomSerialNo": "{{userName}}", "Data": [{ "nMsgNum": 1, "nMsgType": 2004, "msgContent": "https://wx.qlogo.cn/mmhead/ver_1/cUQCMiauQnCQrpOOdttRYElBiauERPUb6OfeHKxuTyypo989hae15NWbKyTGuPSCzMGJrZvOhkyI8s1b2ulMQ7TK0w8SB2UODvAcxKiajQ5Lmw/0", "nVoiceTime": 20, "vcTitle": "标题", "vcDesc": "描述", "vcHref": "http://siyouyun-1253559996.cos.ap-guangzhou.myqcloud.com/common/BUG44/20200507/1588819876378NYN/normal_video.mp4?sign=q-sign-algorithm%3Dsha1%26q-ak%3DAKIDBi7d3I4UK7iDXkAhQyQsDMNGxY2KmlCY%26q-sign-time%3D1588819868%3B1675133468%26q-key-time%3D1588819868%3B1675133468%26q-header-list%3D%26q-url-param-list%3D%26q-signature%3De314c1509b258501c1d4536d580d38fa5268c92f", "vcAtWxSerialNos":[""] }] } ``` --- **发送GIF图片** ``` { "vcMerchantNo": "{{appId}}", "vcRobotSerialNo": {{uin}}, "vcRelaSerialNo": "{{msgid}}", "vcChatRoomSerialNo": "{{userName}}", "Data": [{ "nMsgNum": 1, "nMsgType": 2008, "msgContent": "https://img.ixiaocong.com/image/activity/1d77b4c2d03442c5bc26a0ef188f8bd6.gif", "nVoiceTime": 20, "vcTitle": "", "vcDesc": "", "vcHref": "", "vcAtWxSerialNos":[""] }] } ``` --- **发送小程序** ``` { "vcMerchantNo": "{{appId}}", "vcRobotSerialNo": {{uin}}, "vcRelaSerialNo": "{{msgid}}", "vcChatRoomSerialNo": "{{userName}}", "Data": [{ "nMsgNum": 8, "nMsgType": 2013, "msgContent": "PD94bWwgdmVyc2lvbj0iMS4wIj8+Cjxtc2c+Cgk8YXBwbXNnIGFwcGlkPSIiIHNka3Zlcj0iMCI+CgkJPHRpdGxlPjHngrnngrnngrnngrnngrnngrnngrnngrnngrnngrkrPC90aXRsZT4KCQk8ZGVzPjHngrnngrkrPC9kZXM+CgkJPGFjdGlvbiAvPgoJCTx0eXBlPjMzPC90eXBlPgoJCTxzaG93dHlwZT4wPC9zaG93dHlwZT4KCQk8c291bmR0eXBlPjA8L3NvdW5kdHlwZT4KCQk8bWVkaWF0YWduYW1lIC8+CgkJPG1lc3NhZ2VleHQgLz4KCQk8bWVzc2FnZWFjdGlvbiAvPgoJCTxjb250ZW50IC8+CgkJPGNvbnRlbnRhdHRyPjA8L2NvbnRlbnRhdHRyPgoJCTx1cmw+aHR0cHM6Ly9tcC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TBfMF1dPjwvc2hhcmVJZD4KCQkJPGFwcHNlcnZpY2V0eXBlPjA8L2FwcHNlcnZpY2V0eXBlPgoJCTwvd2VhcHBpbmZvPgoJPC9hcHBtc2c+Cgk8ZnJvbXVzZXJuYW1lPnl4YzI1ODQ0MjkyOTwvZnJvbXVzZXJuYW1lPgoJPHNjZW5lPjA8L3NjZW5lPgoJPGFwcGluZm8+CgkJPHZlcnNpb24+MTwvdmVyc2lvbj4KCQk8YXBwbmFtZT48L2FwcG5hbWU+Cgk8L2FwcGluZm8+Cgk8Y29tbWVudHVybD48L2NvbW1lbnR1cmw+CjwvbXNnPg==", "nVoiceTime": 0, "vcTitle": "", "vcDesc": "", "vcHref": "http://www.agri35.com/UploadFiles/img_1_3637625398_761708293_26.jpg", "vcAtWxSerialNos":[""] }] } ```

响应参数

参数名
类型
描述
nResult
Integer
响应状态码(1:成功,其他均为失败)
vcResult
String
接口响应结果
vcSerialNo
String
默认 ""
Data
Object
nResult
Integer
Integer
vcResult
String
接口响应结果
nMsgNum
Integer
当前成功执行序号

响应示例

``` { "nResult": 1, "vcResult": "SUCCESS", "vcSerialNo": "", "Data": [ { "nResult": 1, "vcResult": "SUCCESS", "nMsgNum": 1 } ] } ```

异步推送示例

``` { "data":{ "msgData":[ { "atInGroup":[ "" ], "dtMsgTime":1614066457131, "msgContent":"hello", "nMsgNum":1, "nMsgType":2001, "nVoiceTime":0, "vcDesc":"", "vcHref":"", "vcTitle":"" } ], "nIsHit":2, "nMsgNum":1, "vcChatRoomId":"23906387801@chatroom", "vcChatRoomSerialNo":"23906387801@chatroom", "vcMsgId":6200006140428726370, "vcRelaSerialNo":"abc", "vcToWxId":"" }, "nResult":1, "nType":5002, "vcMerchantNo":"174a632f2a62d655350d2034c199e8d5", "vcResult":"", "vcRobotSerialNo":"496768729", "vcRobotWxId":"wxid_n1zz6y2ksgod22", "vcSerialNo":"496768729" } ```