ThinkChat2.0新版上线,更智能更精彩,支持会话、画图、阅读、搜索等,送10W Token,即刻开启你的AI之旅 广告
# 会话联系人模块 ## **Web端交互** ![](https://img.kancloud.cn/e9/67/e967c4dc87a85ef12a912ff8c06b1de0_231x847.png) ## **API相关文档** 接口描述 | ***删除联系人消息*** ---|--- URL |/wechat_api/message/delMsgByOwnerId 请求方式 | GET 请求参数 | {ownerId:"354976",wechatUserName:"wxid\_3g0lxo7hqx3722",wechatContactUserName:"wxid\_qdooqzajmhpw22",uin:"1153915491"} 返回值 | {"msg":"删除成功!","code":200} | Sort | Param | Type | required | Description | | --- | --- | --- | --- | --- | | 请求参数 | uin | string | Y | uin | 请求参数 | wechatUserName | string | Y | 微信号的username | 请求参数 | wechatcontactUserName | string | Y | 被刪微信号的username | 请求参数 | ownerId| integer| Y | 被删好友的contantID > ***** 接口描述 | **创建群聊** ---|--- URL | /wechat\_api/chatroom/createChatRoom 请求方式 | get 请求参数 | {uin:"2964685533",userName:"Top\_Xin415,wxid\_sd4cpwmel5sy12", topic:"1212",roomNickName:{"userName":"Top\_Xin415","nickName":"🐨"},{"userName":"wxid\_sd4cpwmel5sy12","nickName":"售前-赖剑鑫"} 返回值 | {"msg":"请求发送成功!","code":200} | Sort | Param | Type | required | Description | | --- | --- | --- | --- |--- | | 请求参数 | uin| string| Y | 微信号ID | 请求参数 | userName| string| Y | 群成员中的username | 请求参数 | topic| string| Y | 群名 | 请求参数 | roomNickName| string| Y | 群名称 | 请求参数 | nickName| string| Y | 群中成员昵称 > ***** <br> 接口描述 | **查看最近会话(单聊)** ---|--- URL | /wechat_api/message/findLastMsgList 请求方式 | GET - 请求示例 ``` http://192.168.8.90:30097/wechat_api/message/findLastMsgList?status=1 ``` - 返回值示例 ``` { "msg":"查询成功", "code":200, "data":{ "delData":[ ], "lastMsgList":[ { "wechatContactId":335464, "contactFlag":3, "wechatUserUin":"2123131667", "nickName":"技术-红海", "remarkName":"模拟客户1", "contactType":0, "userName":"wxid_8twmv8pkgvox22", "wechatUserName":"wxid_lbejkr1i6jl922", "headImgUrl":"http://wx.qlogo.cn/mmhead/ver_1/VoCpsvCNyb6HjOHZaALNqjhf44efXoFQuKNHmvG949n7Kibyk1A2GRR9MrfyFicXmj7RuwUtwJGD6hvrsV4CzAps9BATVn3YmmGEpzRQmAic2w/132", "createTime":"2020-03-09 21:22:53", "lastMsg":"{"content":"","createTime":1583760173240,"fileName":"背景图.jpg","fileSize":"9762","fromUserName":"wxid_lbejkr1i6jl922","loginer":"1","msgId":"6982760926774476952","msgSourceCd":11,"msgType":3,"queueName":"queue.sendMsg_webserviceslocal","sendStatus":1,"toUserName":"wxid_8twmv8pkgvox22","tokenId":"sendFile-1583760172555991","type":"pic","uin":"2123131667","url":"https://siyouyunsy-1253559996.file.myqcloud.com/common/RRZK2/20200227/1582770203412HLS/%E8%83%8C%E6%99%AF%E5%9B%BE.jpg?sign=q-sign-algorithm%3Dsha1%26q-ak%3DAKIDBi7d3I4UK7iDXkAhQyQsDMNGxY2KmlCY%26q-sign-time%3D1582770203%3B1669083803%26q-key-time%3D1582770203%3B1669083803%26q-header-list%3D%26q-url-param-list%3D%26q-signature%3Df65dcac586475a16eb416387343767933d3267c1","wechatUser":"{"wechatUserId":140,"uin":"2123131667","userName":"wxid_lbejkr1i6jl922","nickName":"呵呵海","headImgUrl":"http://wx.qlogo.cn/mmhead/ver_1/mTkojMibehX93lUWRG35Kf9jZBKe0ycKm9TwdhUDvKqOibBWXD6Oc2SfgAiaia8jGwAficAY7medF3qdF7JzTxhOlrIaicibiapmCWQdzYYXZTKJsYc/0","remarkName":null,"remarkPYInitial":null,"remarkPYQuanPin":null,"sex":"","status":1,"verifyFlag":"0","adminUserId":null,"createTime":null,"lastLoginTime":null,"lastLoginIP":null,"secName":null,"flag":null,"wechatMeta":null,"serverId":"Ipad_001","childId":"04","mqServerId":"Ipad_001_04","meta":null,"snsBg":null,"area":null,"signature":null,"phone":null,"bindQQ":null,"pyinitial":null,"pyquanPin":null}"}", "wechatUserId":140, "uin":"2123131667", "time":1583760173240 } ] } } ``` | Sort | Param | Type | Description | ParamDesc | --- | --- | --- | --- | --- | | req | status | Integer | 状态标识,默认为1 | > ***** <br> 接口描述 | **查看最近会话(群聊)** ---|--- URL | /wechat_api/message/findLastMsgList 请求方式 | GET - 请求示例 ``` http://192.168.8.90:30097/wechat_api/message/findLastMsgList?adminUserId=1&uin=2123131667&isRoom=0&page=1&wechatContactName= ``` - 返回值示例 ``` [ { "createTime":"2020-03-09 21:37:31", "wechatContactId":335679, "wechatUserId":140, "chatRoomSettings":"0", "contactType":0, "uin":"2123131667", "wechatUserUin":"2123131667", "wechatUserName":"wxid_lbejkr1i6jl922", "userName":"11170134085@chatroom", "nickName":"正宗测试群", "remarkName":"", "contactFlag":3, "isDelete":0, "headImgUrl":"http://wx.qlogo.cn/mmcrhead/yFib6icQmwUBtGFCb6BFoCyicib4cSap2l0ibSYQo5rpGE8ZaFibZS2lxqG7qyTtcyyxsXfKZtqnYumbPXy5tX7ibOiciarHqsvtoWy6u/0", "isSaving":null, "seq":"11170134085@chatroom", "verifyFlag":"0", "pyinitial":"正宗测试群", "pyquanPin":"正宗测试群", "time":1583761051177, "lastMsg":"{"content":"ddddd","createTime":1583761051177,"fromUserName":"wxid_lbejkr1i6jl922","loginer":"1","msgId":"810434016282453936","msgSourceCd":11,"msgType":1,"queueName":"queue.sendMsg_webserviceslocal","sendStatus":1,"toUserName":"11170134085@chatroom","tokenId":"sendMsg-158376105113795","uin":"2123131667","wechatUser":"{"wechatUserId":140,"uin":"2123131667","userName":"wxid_lbejkr1i6jl922","nickName":"呵呵海","headImgUrl":"http://wx.qlogo.cn/mmhead/ver_1/mTkojMibehX93lUWRG35Kf9jZBKe0ycKm9TwdhUDvKqOibBWXD6Oc2SfgAiaia8jGwAficAY7medF3qdF7JzTxhOlrIaicibiapmCWQdzYYXZTKJsYc/0","remarkName":null,"remarkPYInitial":null,"remarkPYQuanPin":null,"sex":"","status":1,"verifyFlag":"0","adminUserId":null,"createTime":null,"lastLoginTime":null,"lastLoginIP":null,"secName":null,"flag":null,"wechatMeta":null,"serverId":"Ipad_001","childId":"04","mqServerId":"Ipad_001_04","meta":null,"snsBg":null,"area":null,"signature":null,"phone":null,"bindQQ":null,"pyinitial":null,"pyquanPin":null}"}" }, { "createTime":"2020-03-09 21:34:42", "wechatContactId":335524, "wechatUserId":140, "chatRoomSettings":"0", "contactType":0, "uin":"2123131667", "wechatUserUin":"2123131667", "wechatUserName":"wxid_lbejkr1i6jl922", "userName":"21774255049@chatroom", "nickName":"测试修改", "remarkName":"", "contactFlag":3, "isDelete":0, "headImgUrl":"http://wx.qlogo.cn/mmcrhead/iasNR98ThFGM3DJicQL1gOQbnoeUGPPxIQwOzV4Zv7NLZ48zsXpmwZyPdYruvx50oEmn2tCFBfTCErvWFyV2PN6klzQAUmAqOt/0", "isSaving":null, "seq":"21774255049@chatroom", "verifyFlag":"0", "pyinitial":"测试修改", "pyquanPin":"测试修改", "time":1583760882786, "lastMsg":"{"content":"32","createTime":1583760882786,"fromUserName":"wxid_lbejkr1i6jl922","loginer":"1","msgId":"4076713874955501752","msgSourceCd":11,"msgType":1,"queueName":"queue.sendMsg_webserviceslocal","sendStatus":1,"toUserName":"21774255049@chatroom","tokenId":"sendMsg-1583760882325596","uin":"2123131667","wechatUser":"{"wechatUserId":140,"uin":"2123131667","userName":"wxid_lbejkr1i6jl922","nickName":"呵呵海","headImgUrl":"http://wx.qlogo.cn/mmhead/ver_1/mTkojMibehX93lUWRG35Kf9jZBKe0ycKm9TwdhUDvKqOibBWXD6Oc2SfgAiaia8jGwAficAY7medF3qdF7JzTxhOlrIaicibiapmCWQdzYYXZTKJsYc/0","remarkName":null,"remarkPYInitial":null,"remarkPYQuanPin":null,"sex":"","status":1,"verifyFlag":"0","adminUserId":null,"createTime":null,"lastLoginTime":null,"lastLoginIP":null,"secName":null,"flag":null,"wechatMeta":null,"serverId":"Ipad_001","childId":"04","mqServerId":"Ipad_001_04","meta":null,"snsBg":null,"area":null,"signature":null,"phone":null,"bindQQ":null,"pyinitial":null,"pyquanPin":null}"}" } ] ``` | Sort | Param | Type | Description | ParamDesc | --- | --- | --- | --- | --- | | req | adminUserId | Integer | 系统账号Id | | req | uin | String | 微信uin| | req | page | Integer | 1 | | req | wechatContactName | String | 默认为空 | > ***** <br> 接口描述 | **标记星标群** ---|--- URL | /wechat\_api/wechatContact/updateSetting 请求方式 | get 请求参数 | {contactId:"46980552",setting:"3",wechatUserName:"wxid\_mjxv8kbxje8b22",uin:"2964685533"} 返回值 | {"msg":"保存成功","code":200} | Sort | Param | Type | required | Description | | --- | --- | --- | --- |--- | | 请求参数 | contactId| Long | Y | 群聊ID | 请求参数 | setting| Interger | Y |状态: 0默认;1提醒不接收;2屏蔽,3:星标 | 请求参数 | wechatUserName| string | Y | 微信号的用户名 | 请求参数 | uin| string | Y | 微信号ID > ***** 接口描述 | **同步群聊到手机通讯录** ---|--- URL | /wechat\_api/wechatuser/syncContact 请求方式 | get 请求参数 | {uin:"2964685533"} 返回值 | {"code":200,"msg":"同步请求已提交,请耐心等待!","data":null} | Sort | Param | Type | required | Description | | --- | --- | --- | --- |--- | | 请求参数 | uin| string | Y | 微信号ID > ***** 接口描述 | **查看群聊好友** ---|--- URL | /wechat\_api/chatroom/getMember 请求方式 | get 请求参数 | {uin:"2964685533",userName:"wxid\_mjxv8kbxje8b22",charRoomId:"16243956543@chatroom"} 返回值 | "[{\"PYInitial\":\"\",\"PYQuanPin\":\"\",\"alias\":\"\",\"appAccountFlag\":0,\"attrStatus\":\"\",\"chatRoomId\":0,\"city\":\"\",\"displayName\":\"\",\"encryChatRoomId\":\"\",\"headImgUrl\":\"http://wx.qlogo.cn/mmhead/ver_1/txGsOyzKl6MHU5qt9MdWuqrZf8Iy4icG9hGm5ibPAYia22YNSqYdOo9dEjFELAnibeU1FHrQeM7XpCVaIMPIOWGKWUjlubYWYPfiaZlX3F5Du2GU/132\",\"isOwner\":0,\"keyWord\":\"\",\"memberId\":0,\"memberStatus\":0,\"nickName\":\"夏虫不可@冰\",\"province\":\"\",\"remarkName\":\"\",\"remarkPYInitial\":\"\",\"remarkPYQuanPin\":\"\",\"signature\":\"\",\"snsFlag\":0,\"starFriend\":0,\"statues\":0,\"uin\":\"\",\"uniFriend\":0,\"userName\":\"wxid_gugp2j0tlwmv22\",\"wechatContactId\":46916471,\"wechatContactUserName\":\"16243956543@chatroom\",\"wechatUserUin\":\"2964685533\"},{\"PYInitial\":\"\",\"PYQuanPin\":\"\",\"alias\":\"\",\"appAccountFlag\":0,\"attrStatus\":\"\",\"chatRoomId\":0,\"city\":\"\",\"displayName\":\"\",\"encryChatRoomId\":\"\",\"headImgUrl\":\"http://wx.qlogo.cn/mmhead/ver_1/2oTsia7snBuLNCzysuhPzWyhPBXyQkxibFVbpicVeO2GicS30hUSGMokxLIDfopObKdNXBBxxewkvbMfO7Jiaic6CCL6liacQw4g9nYcqEdLicXM8TA/132\",\"isOwner\":0,\"keyWord\":\"\",\"memberId\":0,\"memberStatus\":0,\"nickName\":\"小陶同学\",\"province\":\"\",\"remarkName\":\"\",\"remarkPYInitial\":\"\",\"remarkPYQuanPin\":\"\",\"signature\":\"\",\"snsFlag\":0,\"starFriend\":0,\"statues\":0,\"uin\":\"\",\"uniFriend\":0,\"userName\":\"wxid_mjxv8kbxje8b22\",\"wechatContactId\":46916471,\"wechatContactUserName\":\"16243956543@chatroom\",\"wechatUserUin\":\"2964685533\"},{\"PYInitial\":\"\",\"PYQuanPin\":\"\",\"alias\":\"\",\"appAccountFlag\":0,\"attrStatus\":\"\",\"chatRoomId\":0,\"city\":\"\",\"displayName\":\"\",\"encryChatRoomId\":\"\",\"headImgUrl\":\"http://wx.qlogo.cn/mmhead/ver_1/wquk6ggqOsddtOaFQVgPkoXJYAmsKOKibO3ZDVjuhzOTo6q2NmWow3Secu0upZjicFnq6NNzmb6DEcoqb2PJFiasMg8aIqRdY21t2wymf8DrIA/132\",\"isOwner\":1,\"keyWord\":\"\",\"memberId\":0,\"memberStatus\":0,\"nickName\":\"过隙\",\"province\":\"\",\"remarkName\":\"\",\"remarkPYInitial\":\"\",\"remarkPYQuanPin\":\"\",\"signature\":\"\",\"snsFlag\":0,\"starFriend\":0,\"statues\":0,\"uin\":\"\",\"uniFriend\":0,\"userName\":\"wxid_5d5jhhgxle4422\",\"wechatContactId\":46916471,\"wechatContactUserName\":\"16243956543@chatroom\",\"wechatUserUin\":\"2964685533\"},{\"PYInitial\":\"\",\"PYQuanPin\":\"\",\"alias\":\"\",\"appAccountFlag\":0,\"attrStatus\":\"\",\"chatRoomId\":0,\"city\":\"\",\"displayName\":\"\",\"encryChatRoomId\":\"\",\"headImgUrl\":\"http://wx.qlogo.cn/mmhead/ver_1/VWsqpeUyASkqUs7YabAm9DicKIOeesXZOLQVCicufurXAKBNcrVUejOy3jB9vUOgHwO3nHSfWyFXdL6qJdyCUd0Hxm6ic8ME6jlW4E3uy0l7fA/132\",\"isOwner\":0,\"keyWord\":\"\",\"memberId\":0,\"memberStatus\":0,\"nickName\":\"黄金柚子茶\",\"province\":\"\",\"remarkName\":\"\",\"remarkPYInitial\":\"\",\"remarkPYQuanPin\":\"\",\"signature\":\"\",\"snsFlag\":0,\"starFriend\":0,\"statues\":0,\"uin\":\"\",\"uniFriend\":0,\"userName\":\"wxid_wjm16q1r7fja22\",\"wechatContactId\":46916471,\"wechatContactUserName\":\"16243956543@chatroom\",\"wechatUserUin\":\"2964685533\"},{\"PYInitial\":\"\",\"PYQuanPin\":\"\",\"alias\":\"\",\"appAccountFlag\":0,\"attrStatus\":\"\",\"chatRoomId\":0,\"city\":\"\",\"displayName\":\"\",\"encryChatRoomId\":\"\",\"headImgUrl\":\"http://wx.qlogo.cn/mmhead/ver_1/7KYkVTRmIv9RXnAT4R1xxjiaMXQSPDJ4GM96Iy4eUY33Dicjm8k3AOxIHgnAjPpiaibBLhic8KiaGW5FmsnR3W1k6GZQ/132\",\"isOwner\":0,\"keyWord\":\"\",\"memberId\":0,\"memberStatus\":0,\"nickName\":\"胡政\",\"province\":\"\",\"remarkName\":\"\",\"remarkPYInitial\":\"\",\"remarkPYQuanPin\":\"\",\"signature\":\"\",\"snsFlag\":0,\"starFriend\":0,\"statues\":0,\"uin\":\"\",\"uniFriend\":0,\"userName\":\"wxid_zgbojbk8tme021\",\"wechatContactId\":46916471,\"wechatContactUserName\":\"16243956543@chatroom\",\"wechatUserUin\":\"2964685533\"},{\"PYInitial\":\"\",\"PYQuanPin\":\"\",\"alias\":\"\",\"appAccountFlag\":0,\"attrStatus\":\"\",\"chatRoomId\":0,\"city\":\"\",\"displayName\":\"\",\"encryChatRoomId\":\"\",\"headImgUrl\":\"http://wx.qlogo.cn/mmhead/ver_1/FxQKdVib2o7oXianREbq1ZgJc6cKcRUremrnELXMpn0UJHcvkfBXRicUdjG3bESibPXOZsXTIPmyFqztwdWrJGxmAG6QwadR5IkcuYK8vhxtN6g/132\",\"isOwner\":0,\"keyWord\":\"\",\"memberId\":0,\"memberStatus\":0,\"nickName\":\"R\",\"province\":\"\",\"remarkName\":\"\",\"remarkPYInitial\":\"\",\"remarkPYQuanPin\":\"\",\"signature\":\"\",\"snsFlag\":0,\"starFriend\":0,\"statues\":0,\"uin\":\"\",\"uniFriend\":0,\"userName\":\"wxid_d23dl95o4aee22\",\"wechatContactId\":46916471,\"wechatContactUserName\":\"16243956543@chatroom\",\"wechatUserUin\":\"2964685533\"}]" | Sort | Param | Type | required | Description | | --- | --- | --- | --- |--- | | 请求参数 | uin| string | Y | 微信号ID | 请求参数 | userName| string | Y | 微信号username | 请求参数 | charRoomId| string | Y | 群ID > ***** 接口描述 | **设置群敏感词** ---|--- URL | /wechat\_api/chatroom/doSave 请求方式 | get 请求参数 | {keyword:"红丝"} 返回值 | {"msg":"成功","code":200} | Sort | Param | Type | required | Description | | --- | --- | --- | --- |--- | | 请求参数 | keyword| string| Y | 关键词 > ***** 接口描述 | **设置群公告** ---|--- URL | /wechat\_api/chatroom/setAnnouncement 请求方式 | post 请求参数 | { uin:"2964685533",content:"哈哈哈哈",chatRoomId:"21810846158@chatroom"} 返回值 | {"msg":"请求发送成功!","code":200} | Sort | Param | Type | required | Description | | --- | --- | --- | --- |--- | | 请求参数 | uin| string | Y | 微信号ID | 请求参数 | content| string | Y |群公告内容 | 请求参数 | chatRoomId| string | Y | 群ID > ***** 接口描述 | **删除并退出群聊** ---|--- URL | /wechat\_api/chatroom/deleteChatRoom 请求方式 | get 请求参数 | {uin:"2964685533",chatRoomId:"23401646124@chatroom"} 返回值 | {"msg":"请求发送成功!","code":200} | Sort | Param | Type | required | Description | | --- | --- | --- | --- |--- | | 请求参数 | uin| string| Y | 微信号ID | 请求参数 | chatRoomId| string| Y | 群ID > ***** 接口描述 | **查看群聊好友头像** ---|--- URL | /wechat\_api/chatroom/getMemberHeadImg 请求方式 | get 请求参数 | {uin:"2964685533",userName:"wxid\_mjxv8kbxje8b22",charRoomId:"16243956543@chatroom"} 返回值 | > ***** 接口描述 | **删除并退出群聊** ---|--- URL | /wechat\_api/chatroom/getGroupCount 请求方式 | get 请求参数 | {uin:"2964685533",chatRoomId:"23401646124@chatroom"} 返回值 | {"msg":"请求发送成功!","code":200} | Sort | Param | Type | required | Description | | --- | --- | --- | --- |--- | | 请求参数 | uin| string| Y | 微信号ID | 请求参数 | chatRoomId| string| Y | 群ID > ***** 接口描述 | **获取群成员详情** ---|--- URL | /wechat_api/wechatContact/ipadGetMemberDetail 请求方式 | get 请求参数 | chatRoomName,uin,userName 返回值 | {"msg":"获取群成员详情成功!","code":200} | Sort | Param | Type | required | Description | | --- | --- | --- | --- |--- | | 请求参数 | uin| string| Y | 微信号ID | 请求参数 | chatRoomName | string| Y | 群ID | 请求参数 | userName| string| Y | userName > ***** 接口描述 | **添加群成员为好友** ---|--- URL|/wechat_api/wechatContact/addChatRoomContactAndRecord 请求方式 | get 请求参数 | chatRoomName,uin,userName,verify 返回值 | {"msg":"添加群好友成功!","code":200} | Sort | Param | Type | required | Description | | --- | --- | --- | --- |--- | | 请求参数 | uin| string| Y | 微信号ID | 请求参数 | chatRoomName | string| Y | 群ID | 请求参数 | userName| string| Y | userName | 请求参数 | verify| string| N | 验证信息 > ***** 接口描述 | **搜索好友** ---|--- URL|/wechat_api/wechatContact/ipadSearchContact 请求方式 | get 请求参数 | type,uin,userName,verify 返回值 | {"msg":"搜索好友请求成功!","code":200} | Sort | Param | Type | required | Description | | --- | --- | --- | --- |--- | | 请求参数 | uin| string| Y | 微信号ID | 请求参数 | type| string| N | 类型 | 请求参数 | userName| string| Y | userName | 请求参数 | verify| string| N | 验证信息 > ***** 接口描述 | **同步好友信息** ---|--- URL|/wechat_api/wechatContact/ipadGetContact 请求方式 | get 请求参数 | uin,userName 返回值 | {"msg":"同步好友请求成功!","code":200,data:null} | Sort | Param | Type | required | Description | | --- | --- | --- | --- |--- | | 请求参数 | uin| string| Y | 微信号ID | 请求参数 | userName| string| Y | userName