企业🤖AI智能体构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
# 聊天窗口模块 ## **Web端交互** ![](https://img.kancloud.cn/a2/bf/a2bf00f00cadf7ee64839f0dffb8b7a8_692x848.png) ## **API相关文档** 接口描述 | **发送图片消息** ---|--- URL | /wechat_api/message/sendFileMsg 请求方式 | POST 请求参数 | {"uin":"24323538036","msgType":"3","fromUserName":"wxid_1yf4qxydy38b12","toUserName":"wxid_8twmv8pkgvox22","loginer":"2206","type":"pic","tokenId":"sendFile-1552913364779126","fileName":"测试发送图片","fileUrl":"http://stg-iobs-upload.pingan.com.cn/download/pad-mvp-file-dmz-stg/weremote-tenant-dx-reply-account-TINGKU201-jpg-15616025027401.jpg?name=测试10.jpg","fileSize":"1687" } 返回值 | {</br>"msg": "上传文件成功",</br>"code": 200</br>} | Sort | Param | Type | required | Description | | --- | --- | --- | --- | --- | | 请求参数 |uin|string|Y|uin | 请求参数 |msgType|int|Y|图片固定为3 | 请求参数 |fromUserName|string|Y|发送者微信号 | 请求参数 |toUserName|string|Y|接收者微信号 | 请求参数 |loginer|int|Y|登录人ID | 请求参数 |type|string|Y|图片为pic | 请求参数 |tokenId|string|Y|请求序号,sendFile-14位随机数 | 请求参数 |fileName|string|Y|图片文件名 | 请求参数 |fileUrl|string|Y|图片url | 请求参数 |fileSize|int|Y|图片大小 > ***** <br> 接口描述 | **检测发送图片消息状态** ---|--- URL | wechat_api/message/getWsReceive 请求方式 | GET - 请求示例 ``` http://192.168.8.90:30097/wechat_api/message/getWsReceive?uin=2123131667&userName=wxid_lbejkr1i6jl922&cmdId=sendMsg-158376014633942 ``` - 返回值示例 ``` { "code":200, "status":"4" } ``` | Sort | Param | Type | Description | ParamDesc | --- | --- | --- | --- | --- | | req | uin | String | 微信号uin | | req | userName | String | 微信号wxid | | req | cmdId | String | 发送消息的tokenId > ***** <br> 接口描述 | **获取图片媒体流** ---|--- URL | wechat_api/message/sendMediaMessage 请求方式 | POST Content-Type | application/json;charset=UTF-8 - 请求示例 ``` { "fromUserName":"wxid_8twmv8pkgvox22", "toUserName":"wxid_lbejkr1i6jl922", "msgType":3, "MsgType":3, "url":"http://siyouyunsy-1253559996.cos.ap-guangzhou.myqcloud.com/msg/RRZK2/20200309/8463984522010146526_wxid_lbejkr1i6jl922_1583763617943_.png?sign=q-sign-algorithm%3Dsha1%26q-ak%3DAKIDBi7d3I4UK7iDXkAhQyQsDMNGxY2KmlCY%26q-sign-time%3D1583763618%3B1670077218%26q-key-time%3D1583763618%3B1670077218%26q-header-list%3D%26q-url-param-list%3D%26q-signature%3Dac39f80a894c2e933954553a010c1cd65afb71a1", "content":"<?xml version="1.0"?> <msg> <img aeskey="6670376d31766e3070346f6c65326b32" encryver="0" cdnthumbaeskey="6670376d31766e3070346f6c65326b32" cdnthumburl="30570201000450304e0201000204c740a6e002032f80290204d6833cb702045e6650a10429777875706c6f61645f777869645f6c62656a6b723169366a6c39323231345f313538333736333631360204010818020201000400" cdnthumblength="4681" cdnthumbheight="120" cdnthumbwidth="101" cdnmidheight="0" cdnmidwidth="0" cdnhdheight="0" cdnhdwidth="0" cdnmidimgurl="30570201000450304e0201000204c740a6e002032f80290204d6833cb702045e6650a10429777875706c6f61645f777869645f6c62656a6b723169366a6c39323231345f313538333736333631360204010818020201000400" length="11345" md5="15099d2d8320462b4294439f8fda6c66" /> </msg> ", "uin":"2123131667", "Uin":"2123131667", "msgId":"8463984522010146526", "loginer":1, "Content":"<?xml version="1.0"?> <msg> <img aeskey="6670376d31766e3070346f6c65326b32" encryver="0" cdnthumbaeskey="6670376d31766e3070346f6c65326b32" cdnthumburl="30570201000450304e0201000204c740a6e002032f80290204d6833cb702045e6650a10429777875706c6f61645f777869645f6c62656a6b723169366a6c39323231345f313538333736333631360204010818020201000400" cdnthumblength="4681" cdnthumbheight="120" cdnthumbwidth="101" cdnmidheight="0" cdnmidwidth="0" cdnhdheight="0" cdnhdwidth="0" cdnmidimgurl="30570201000450304e0201000204c740a6e002032f80290204d6833cb702045e6650a10429777875706c6f61645f777869645f6c62656a6b723169366a6c39323231345f313538333736333631360204010818020201000400" length="11345" md5="15099d2d8320462b4294439f8fda6c66" /> </msg> " } ``` > 备注:参数填充参考接收到的消息内容参数 - 返回值示例 ``` { "msg":"发送成功", "code":200 } ``` | Sort | Param | Type | Description | ParamDesc | --- | --- | --- | --- | --- | > ***** <br> 接口描述 | ***发送文本消息*** ---|--- URL | /wechat_api/message/sendMessage 请求方式 | POST 请求参数 | {"uin":"24323538036","msgType":"1","fromUserName":"wxid_1yf4qxydy38b12","toUserName":"12272226587@chatroom","loginer":"2206","tokenId":"sendMsg-1552913364779126","fileName":"wxid_4lr4ahr4iw3122","content":"您好!!!"} 返回值 | {</br>"msg": "上传文件成功",</br>"code": 200</br>} | Sort | Param | Type | required | Description | | --- | --- | --- | --- | --- | | 请求参数 | uin | string | Y | uin | 请求参数 | msgType | int | Y | {1:文本消息} | 请求参数 | fromUserName | string | Y | 发送者微信号 | 请求参数 | toUserName | string | Y | 接收者微信号 | 请求参数 | loginer | int | Y | 登录人ID | 请求参数 | tokenId | string | Y | 请求序号,sendMsg-14位随机数 | 请求参数 | fileName | string | N | 需要@人的微信号wxid_4lr4ahr4iw3122 | 请求参数 | MTYPE |string| Y | 发送文本消息固定为sendMessage | 请求参数 | content |string| Y | 发送文本内容 > ***** 接口描述 | ***语音转文本*** ---|--- URL |/wechat_api/message/voiceToText 请求方式 | GET 请求参数 | {voiceUrl:"string", msgId:"string"} 返回值 | | Sort | Param | Type | required | Description | | --- | --- | --- | --- | --- | | 请求参数 | voiceUrl | string | Y | 语音的url | 请求参数 | msgId| string | Y | 微信官方的msgId > ***** - API infomation 接口描述 | ***文件上传*** ---|--- URL |/wechat_api/qiniu/getUploadToken 请求方式 | GET 请求参数 | ?key=1578489128776xyU/2.png&&prefix=msg - params infomation | Sort | Param | Type | required | Description | | --- | --- | --- | --- | --- | | 请求参数 | key | string | Y | 用于生成返回文件链接的后缀 | 请求参数 | prefix| string | Y | 固定参数 - response example ``` { "code":200, "msg":"操作成功", "data":{         "cred":"{"authorization":"q-sign-algorithm=sha1&q-ak=AKIDYxSB7ObErTJoVEv3gzKw2V5nkc93gv1a&q-sign-time=1578489128;1578489728&q-key-time=1578489128;1578489728&q-header-list=&q-url-param-list=&q-signature=2396f19a8ceebfdf50847bad1f901d690c8b5ea9","bucketName":"siyouyunsy-1253559996","region":"ap-guangzhou","token":"939a5dd9c4868fd01ec8d945ae0ba94619d25f3630001"}",         "authKey":"TAOMQ",         "host":"[https://siyouyunsy-1253559996.file.myqcloud.com](https://siyouyunsy-1253559996.file.myqcloud.com/)",         "isPrivate":1,         "type":3,         "key":"/msg/TAOMQ/20200108/1578489128776xyU/2.png"     } } ```