企业🤖AI Agent构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
# 客户查询模块 ##### 作者:未知 ##### 时间:未知 ##### 版本:V4.1.0 ##### 修改: |更新时间|更新人|作用| |--|--|--| |2020- 04- 22| 黄文榕 | 新增接口/findcontactbytagall | |2020- 05- 05| 李小琳 | 新增 手动录入查询列表接口/getManualTaskList、手动录入查询任务详情接口/getManualTaskDetail、删除手动录入主任务 /delManualTask、删除手动录入任务详情 /delManualTaskDetail | |2020- 05- 19| 黄文榕 |更新 接口/findcontactbytagall |2020- 05- 22| 李小琳 |新增 接口 /wechat_api/customer/addManualTaskBeforeAddFriend | ## **Web端交互** > ***** ![(images/screenshot_1567145572362.png)](https://img.kancloud.cn/ce/f4/cef436d22b0f2619164192f7f92c8710_1088x790.png) ## **API相关文档** > ***** 接口描述 | **客户查询** ---|--- URL | /wechat\_api/customer/customerPage 请求方式 | get 请求参数 |{customerName=&customerPhone=&tagIds=&beginTime=&endTime=&remarks=&limit=10&pageNo=1} 返回值 | {"code":200,"data":[],"pageNo":1,"count":0} | Sort | Param | Type | required | Description | | --- | --- | --- | --- |--- | | 请求参数 | customerName| string | Y |客户名 | 请求参数 | customerPhone| string | Y |客户手机号 | 请求参数 | tagIds| string | Y |标签ID | 请求参数 | beginTime| string | Y |开始时间 | 请求参数 | endTime| string | Y |结束时间 | 请求参数 | remarks| string | Y |备注名 | 请求参数 | limit| string | Y |分页查询 | 请求参数 | pageNo| string | Y |分页查询 > ***** 接口描述 | **导出客户资料** ---|--- URL | /wechat\_api/customer/downLoad 请求方式 | get 请求参数 | {customerName=&customerPhone=&tagIds=&beginTime=&endTime=&remarkName=&wechatUserId=&limit=10&pageNo=1} 返回值 | {"code":200,"data":[],"pageNo":1,"count":0} | Sort | Param | Type | required | Description | | --- | --- | --- | --- |--- | | 请求参数 | beginTime| string | Y |开始时间 | 请求参数 | endTime| string | Y |结束时间 | 请求参数 | customerName| string | Y |客户名 | 请求参数 | customerPhone| string | Y |客户手机号 | 请求参数 | remarkName| string | Y |备注名 | 请求参数 | wechatUserId| string | Y |微信号ID | 请求参数 | limit和pageNo| int| Y |分页查询 | 请求参数 | tagIds| string | Y |标签ID > ***** 接口描述 | **修改客户资料** ---|--- URL | /wechat\_api/customer/updateCustomer 请求方式 | post 请求参数 | {customerPhone:"11111122222", customerName:"售前-红海",nickName:"售前红海", xfield1:"", remarks:"售前-红海哥",tags:"",customerId:"3063060", wechatContactId:"19564131",isStar:""} 返回值 | {"wechatContact":{"page":{"pageNo":1,"pageSize":-1,"count":0,"content":[],"html":"<ul>\n<li><a href=\"javascript:\" onclick=\"page(0,-1,'');\">&#171; 上一页</a></li>\n<li><a href=\"javascript:\" onclick=\"page(0,-1,'');\">1</a></li>\n<li><a href=\"javascript:\" onclick=\"page(0,-1,'');\">下一页 &#187;</a></li>\n<li class=\"disabled controls\"><a href=\"javascript:\">当前 <input type=\"text\" value=\"1\" onkeypress=\"var e=window.event||this;var c=e.keyCode||e.which;if(c==13)page(this.value,-1,'');\" onclick=\"this.select();\"/> / <input type=\"text\" value=\"-1\" onkeypress=\"var e=window.event||this;var c=e.keyCode||e.which;if(c==13)page(1,this.value,'');\" onclick=\"this.select();\"/> 条,共 0 条</a></li>\n</ul>\n<div style=\"clear:both;\"></div>","firstResult":0,"maxResults":-1},"sqlMap":{},"wechatContactId":19564131,"wechatUserId":13806,"uin":"0","userName":"wxid_8twmv8pkgvox22","nickName":"售前-红海","headImgUrl":"http://wx.qlogo.cn/mmhead/ver_1/a7VEaKQezTBzyXcqCaHKdVwia4Zb4CTfmqz541bL2w9ClH5icRTib3OKQWGbgba0AJP19PvKebXVAcOaG7dKHfSCWfxKUpG2RIxvCIeyKgSrpY/132","remarkName":"","pYInitial":"SQHH","pYQuanPin":"shouqianhonghai","remarkPYInitial":"","remarkPYQuanPin":"","sex":"1","verifyFlag":"0","isDelete":0,"isSaving":0,"wechatUserName":"wxid_oo8w553uj5g612","contactFlag":"3","province":"","city":"","wechatUserUin":"663329897","chatRoomSettings":0,"contactType":0,"seq":"wxid_8twmv8pkgvox22","pyinitial":"SQHH","pyquanPin":"shouqianhonghai"},"code":200,"customer":{"page":{"pageNo":1,"pageSize":-1,"count":0,"content":[],"html":"<ul>\n<li><a href=\"javascript:\" onclick=\"page(0,-1,'');\">&#171; 上一页</a></li>\n<li><a href=\"javascript:\" onclick=\"page(0,-1,'');\">1</a></li>\n<li><a href=\"javascript:\" onclick=\"page(0,-1,'');\">下一页 &#187;</a></li>\n<li class=\"disabled controls\"><a href=\"javascript:\">当前 <input type=\"text\" value=\"1\" onkeypress=\"var e=window.event||this;var c=e.keyCode||e.which;if(c==13)page(this.value,-1,'');\" onclick=\"this.select();\"/> / <input type=\"text\" value=\"-1\" onkeypress=\"var e=window.event||this;var c=e.keyCode||e.which;if(c==13)page(1,this.value,'');\" onclick=\"this.select();\"/> 条,共 0 条</a></li>\n</ul>\n<div style=\"clear:both;\"></div>","firstResult":0,"maxResults":-1},"sqlMap":{},"customerId":3063060,"customerName":"售前-红海","customerPhone":"11111122222","remarks":"售前-红海哥","wechatContactId":19564131,"lastUpdateTime":1565164517924,"tags":"","isCust":0,"nickName":"售前红海","xfield1":""}} | Sort | Param | Type | required | Description | | --- | --- | --- | --- |--- | | 请求参数 | nickName| string | Y |微信昵称 | 请求参数 | remarks| string | Y | 客户备注 | 请求参数 | customerName| string | Y | 客户名 | 请求参数 | customerPhone| string | Y | 客户手机号 | 请求参数 | tags| string | Y | 客户标签 | 请求参数 | customerId| string | Y |客户ID | 请求参数 | wechatContactId| integer| Y | 绑定的联系人 | 请求参数 | isStar| string | Y | 是否星标好友 | 请求参数 | xfield1| string | Y | 用户自定义字段 > ***** 接口描述 | **删除客户** ---|--- URL | /wechat\_api/customer/delete 请求方式 | post 请求参数 | customerId:"3063253", 返回值 | {"code":200,"data":[],"pageNo":1,"count":0} | Sort | Param | Type | required | Description | | --- | --- | --- | --- |--- | | 请求参数 | customerId| string | Y |客户ID > ***** 接口描述 | **查看与客户的聊天记录** ---|--- URL | /wechat\_api/message/getRedisMessageRecord 请求方式 | get 请求参数 | adminUserId=33726&wechatUserIds=13806&wechatContactIds=19564131&beginTime=&endTime=&limit=&pageNo= 返回值 | {"code":200,"data":[],"pageNo":1,"count":0} | Sort | Param | Type | required | Description | | --- | --- | --- | --- |--- | | 请求参数 | adminUserId| string | Y |管理员账号ID | 请求参数 | wechatUserIds| string | Y |微信号的ID | 请求参数 | wechatContactIds| string | Y |微信联系人ID | 请求参数 | beginTime| string | Y |开始时间 | 请求参数 | endTime| string | Y |结束时间 | 请求参数 | limit和pageNo| string | Y |分页 > ***** 接口描述 | **添加个性称呼** ---|--- URL | /wechat\_api/customer/batchSaveNickName 请求方式 | post 请求参数 | nickNames:{"wechatContactId":47666822,"custName":"陈佳","nickName":"陈佳"} 返回值 |{"msg":"保存成功!","code":200} | Sort | Param | Type | required | Description | | --- | --- | --- | --- |--- | | 请求参数 | wechatContactId| string | Y |微信联系人ID | 请求参数 | custName| string | Y |客户昵称 | 请求参数 | nickName| string | Y |个性称呼 > ***** ### 通过标签获取客户列表 - url: /wechat_api/customer/findcontactbytagAll - 调用方式: get #### 接口介绍: 通过标签获取客户列表(可获取子账号的) ##### 传参: 属性名 | 类型| 是否必要 | 备注 ---|--- |---| --- wechatUserId | String| N | 用户id tagIds |String|N|标签ID isOffLine|Integer|isOnline不为空的话可以搜索出不在线的 ``` ?wechatUserId=746&tagIds=81100608 ``` ##### 出参: 属性名 | 类型| 备注 ---|--- | --- code| Integer | 返回码 msg | String | 消息 data | list |返回数据 data: 属性名 | 类型| 备注 ---|--- | --- wechatContactId| Integer | 联系人Id wechatUserId| Integer | 微信号id uin| String |uin userName| String |userName nickName| String |昵称 headImgUrl| String |头像地址 sex| String |性别 verifyFlag| String | isDelete| Integer| 是否删除 isSaving| Integer |是否保存 wechatUserName| String |自己的userName wechatUserNickName| String | 自己的昵称 adminUserId| Integer| 账号id customerNickName| String |个性称呼 ``` { "code": 200, "msg": "操作成功!", "data":"data": [         { "wechatContactId": 1000004734, "wechatUserId": 746, "uin": "0", "userName": "wxid\_az12gf9ugnoh22", "nickName": "broccoli", "headImgUrl": "http://wx.qlogo.cn/mmhead/ver\_1/ibiaQia8UnUtQE5I3qjTCLeYjnPhmv4qXLxVHfRIYS2UAiaeeXxWHYHme9OVp3s6hsgnPtfOPYiaRvW3nOaVS6laSJDuFzZvVmYa5VVhzILwj28I/132", "remarkName": "", "remarkPYInitial": "", "remarkPYQuanPin": "", "sex": "2", "verifyFlag": "0", "isDelete": 0, "isSaving": null, "memberCount": null, "groupId": null, "wechatUserName": "wxid\_jmg3nu2goog222", "alias": "zzzslcn", "contactFlag": "3", "province": "", "city": "", "op": null, "wechatUserUin": "301965671", "chatRoomSettings": 0, "contactType": 0, "seq": "wxid\_az12gf9ugnoh22", "groupName": null, "adminUserId": 11793, "wechatUserNickName": "你看那茶树满山", "customerNickName": null, "pyinitial": "BROCCOLI", "pyquanPin": "broccoli"         }     ] } //该接口没有预设报错项 ``` ### V4.2.0 查询拨打电话后是否开启弹窗 * url: /wechat_api/customer/getIsOpenAfterCall * 调用方式:get ##### 传参:无 ##### 出参: | 属性名 | 类型 | 备注 | | --- | --- | --- | | code | Integer | 状态码 | | msg | String | 消息 | | data | Integer| | 1开启,0关闭 ##### 出参示例: ~~~ { "code": 200, "msg": "操作成功!", "data": 0 } ~~~ ### V4.2.0 更新是否开启弹窗状态 * url: /wechat_api/customer/updateIsOpenAfterCall * 调用方式:post ##### 传参:无 | 属性名 | 类型 | 是否必要 | 备注 | | --- | --- | --- | --- | | isOpen| Integer| Y | 1:开启,0关闭 | ##### 传参示例: ~~~ { "isOpen":1 } ~~~ ##### 出参: | 属性名 | 类型 | 备注 | | --- | --- | --- | | code | Integer | 状态码 | | msg | String | 消息 | | data | Integer| | ##### 出参示例: ~~~ { "code": 200, "msg": "操作成功!", "data": null } ~~~ ### V4.2.0 导航栏拨打电话的客户信息显示 * url: /wechat_api/customer/getCustomerInfoByCall * 调用方式:get ##### 传参:无 | 属性名 | 类型 | 是否必要 | 备注 | | --- | --- | --- | --- | | phone| String| Y | 客户手机号 | ##### 出参: | 属性名 | 类型 | 备注 | | --- | --- | --- | | code | Integer | 状态码 | | msg | String | 消息 | | data | Object| | source:查询来源,customerList:客户资料 source定义 | 类型 | 备注 | | --- | --- | | 0| 无数据 | | 1| 来源客户资料 | | 2| 来源[分配给我的]客户池 | | 3| 来源手动录入 | ##### 出参示例: ~~~ { "code": 200, "msg": "操作成功!", "data": { "source": 0, "customerList": null     } } ~~~ 或 ![](https://img.kancloud.cn/fd/af/fdaf5f4658d58ef7cff5b96d35fab3e7_1045x799.png) 或 ![](https://img.kancloud.cn/e2/69/e269ee5d342b5630af3080df25597b5b_678x674.png) ### V4.2.0 查询手动录入任务列表 * url: /wechat_api/customer/getManualTaskList * 调用方式:get ##### 传参: | 属性名 | 类型 | 是否必要 | 备注 | | --- | --- | --- | --- | | pageNo | Integer | N | 页码,默认1 | | limit | Integer | N | 每页限制条数,默认20 | | adminUserId | Long | N | 查询 账号| | pepartId | Long | N | 查询部门 | ##### 出参: | 属性名 | 类型 | 备注 | | --- | --- | --- | | code | Integer | 状态码 | | msg | String | 消息 | | data | Object| | ##### 出参示例: ~~~ { "code": 200, "msg": "操作成功!", "data": { "count": 2, "data": [ { "adminUserId": 11855, "realName": "hhhaaa" }, { "adminUserId": 12206, "realName": "李小琳e" } ], "pageNo": 1, "limit": 20 } } ~~~ ### V4.2.0 查询手动录入详情 * url: /wechat_api/customer/getManualTaskDetail * 调用方式:get ##### 传参: | 属性名 | 类型 | 是否必要 | 备注 | | --- | --- | --- | --- | | pageNo | Integer | N | 页码,默认1 | | limit | Integer | N | 每页限制条数,默认20 | | adminUserId | Long | Y | 查询当前人的任务详情,getManualTaskList返回的adminUserId | | company | String | N | 公司名称 | | customerName | String | N | 联系人 | | userName | String | N | 微信号 | | dialStatus | Integer | N | 拨打状态 0未拨打,1已拨打 | | addStatus | Integer | N | 添加状态 | ##### 出参: | 属性名 | 类型 | 备注 | | --- | --- | --- | | code | Integer | 状态码 | | msg | String | 消息 | | data | Object| | ##### 出参示例: ~~~ 正常返回: { "code": 200, "msg": "操作成功!", "data": { "count": 4, "data": [ { "customerId": 19380, "customerName": "客户1", "customerPhone": "18750920000", "address": null, "company": "公司1", "createTime": "2019-11-28 17:17:45", "lastUpdateTime": "2019-11-28 17:17:45", "nickName": "个性1", "uin": null, "adminUserId": 12206, "syn": 1, "userName": "wxid_001", "xfield1": null, "xfield2": null, "xfield3": null, "xfield4": null, "xfield5": null, "xfield6": null, "xfield7": null, "xfield8": null, "xfield9": null, "xfield10": null, "dialStatus": 0, "addStatus": 0, "taskId": -1, "orderNum": 3, "tags": null, "remarks": null } ], "pageNo": 1, "limit": 20 } } adminUserId为空时返回的数据: { "code": 400, "msg": "指定查询的任务详情不能为空", "data": null } ~~~ ### V4.2.0 删除手动录入主任务 * url: /wechat_api/customer/delManualTask * 调用方式:post ##### 传参: | 属性名 | 类型 | 是否必要 | 备注 | | --- | --- | --- | --- | | adminUserId| Long| Y | 删除该人的所有录入任务 | ##### 传参示例: ~~~ 正常返回数据 { "adminUserId":12206 } ~~~ ##### 出参: | 属性名 | 类型 | 备注 | | --- | --- | --- | | code | Integer | 状态码 | | msg | String | 消息 | | data | Object| | ##### 出参示例: ~~~ { "code": 200, "msg": "操作成功!", "data": null } 或 adminUserId为空时返回的数据: { "code": 400, "msg": "adminUserId为空", "data": null } ~~~ ### V4.2.0 删除手动录入任务详情 * url: /wechat_api/customer/delManualTaskDetail * 调用方式:post ##### 传参: | 属性名 | 类型 | 是否必要 | 备注 | | --- | --- | --- | --- | | customerId| Long| Y | 客户池客户信息id | ##### 传参示例: ~~~ { "customerId":19905 } ~~~ ##### 出参: | 属性名 | 类型 | 备注 | | --- | --- | --- | | code | Integer | 状态码 | | msg | String | 消息 | | data | Object| | ##### 出参示例: ~~~ { "code": 200, "msg": "操作成功!", "data": null } 或 { "code": 400, "msg": "customerId为空", "data": null } ~~~ ### V4.2.0添加手动录入任务 * url: /wechat_api/customer/addManualTask * 调用方式:post ##### 传参: | 属性名 | 类型 | 是否必要 | 备注 | | --- | --- | --- | --- | | customerName| String| Y | 客户名称 | | customerPhone| String| Y | 联系方式 | | address| String| N | 地址 | | nickName| String| N | 客户昵称 | | userName| String| N | 微信号| | company| String| N | 公司| | tags| String| N | 标签| | phoneGeo| String| N | 所在地区| | xfield1| String| N | | | xfield2| String| N | | | xfield3| String| N | | | xfield4| String| N | | | xfield5| String| N | | | xfield6| String| N | | | xfield7| String| N | | | xfield8| String| N | | | xfield9| String| N | | | xfield10| String| N | | | v1| String| N | | ##### 传参示例: ~~~ { "customerName":"ceshi", "customerPhone":18750928186, "phoneGeo":"厦门" } ~~~ ##### 出参: | 属性名 | 类型 | 备注 | | --- | --- | --- | | code | Integer | 状态码 | | msg | String | 消息 | | data | Object| | ##### 出参示例: ~~~ { "code": 200, "msg": "操作成功!", "data": null } 或 { "code": 400, "msg": "联系方式不能为空客户姓名不能为空所在地区不能为空", "data": null } ~~~ ### V4.3.0 在手动录入保存前添加微信号 * url: /wechat_api/customer/addManualTaskBeforeAddFriend * 调用方式:post ##### 传参: | 属性名 | 类型 | 是否必要 | 备注 | | --- | --- | --- | --- | | customerPhone| String| Y | 联系方式| | uin| Long| Y | 目标微信号| | userName| String| Y | 联系人手机号或alias| | v1| String| N | v1| ##### 传参示例: ~~~ { "customerPhone": "18756666666", "uin": "496768729", "userName": 18756666666 } ~~~ ##### 出参: | 属性名 | 类型 | 备注 | | --- | --- | --- | | code | Integer | 状态码 | | msg | String | 消息 | | data | Object| | ##### 出参示例: ~~~ { "code": 200, "msg": "操作成功!", "data": { "customerId": 20026, "customerName": "", "customerPhone": "18758888888", "address": null, "createTime": null, "lastUpdateTime": null, "nickName": null, "userName": "3361907914657006851", "company": null, "adminUserId": 11855, "xfield1": null, "xfield2": null, "xfield3": null, "xfield4": null, "xfield5": null, "xfield6": null, "xfield7": null, "xfield8": null, "xfield9": null, "xfield10": null, "taskId": -1, "orderNum": 0, "phoneGeo": "", "tags": null, "assignTime": null, "remarks": null, "v1": "", "dialStatus": 1, "addStatus": 0, "uin": null } } 或 { "code": 400, "msg": "联系方式目标微信号不能为空", "data": null } ~~~