public interface WxMpKefuService
客服接口. 注意:命名采用kefu拼音的原因是:其英文CustomerService如果再加上Service后缀显得有点啰嗦,如果不加又显得表意不完整。
| 限定符和类型 | 方法和说明 | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| boolean | kfAccountAdd(WxMpKfAccountRequest request)
 添加客服账号
 详情请见:
 booleankfAccountDel(String kfAccount)
 删除客服账号
 详情请见:
 booleankfAccountInviteWorker(WxMpKfAccountRequest request)
 设置客服信息(即更新客服信息)
 详情请见:
 booleankfAccountUpdate(WxMpKfAccountRequest request)
 设置客服信息(即更新客服信息)
 详情请见:
 booleankfAccountUploadHeadImg(String kfAccount,
                      File imgFile)
 上传客服头像
 详情请见:
 WxMpKfListkfList()
 获取客服基本信息
 详情请见:
 WxMpKfMsgListkfMsgList(Date startTime,
         Date endTime)
 获取聊天记录(优化接口,返回指定时间段内所有的聊天记录)
 此接口返回的聊天记录中,对于图片、语音、视频,分别展示成文本格式的[image]、[voice]、[video]
 详情请见:
 WxMpKfMsgListkfMsgList(Date startTime,
         Date endTime,
         Long msgId,
         Integer number)
 获取聊天记录(原始接口)
 此接口返回的聊天记录中,对于图片、语音、视频,分别展示成文本格式的[image]、[voice]、[video]
 详情请见:
 WxMpKfOnlineListkfOnlineList() | ||||||||||||||||
| boolean | kfSessionCreate(String openid,
               String kfAccount)
 创建会话
 此接口在客服和用户之间创建一个会话,如果该客服和用户会话已存在,则直接返回0。 | ||||||||||||||||
| WxMpKfSessionGetResult | kfSessionGet(String openid)
 获取客户的会话状态
 此接口获取一个客户的会话,如果不存在,则kf_account为空。 | ||||||||||||||||
| WxMpKfSessionWaitCaseList | kfSessionGetWaitCase()
 获取未接入会话列表
 开发者可以通过本接口获取当前正在等待队列中的会话列表,此接口最多返回最早进入队列的100个未接入会话。 | ||||||||||||||||
| WxMpKfSessionList | kfSessionList(String kfAccount)
 获取客服的会话列表
 开发者可以通过本接口获取某个客服正在接待的会话列表。 | ||||||||||||||||
| boolean | sendKefuMessage(WxMpKefuMessage message)
 发送客服消息
 详情请见: 发送客服消息
 接口url格式:https://api.weixin.qq.com/cgi-bin/message/custom/send? | ||||||||||||||||
| String | sendKefuMessageWithResponse(WxMpKefuMessage message)
 发送客服消息
 详情请见: 发送客服消息
 接口url格式:https://api.weixin.qq.com/cgi-bin/message/custom/send? | ||||||||||||||||
| boolean | sendKfTypingState(String openid,
                 String command)
 客服输入状态
 开发者可通过调用“客服输入状态”接口,返回客服当前输入状态给用户。 | 
boolean sendKefuMessage(WxMpKefuMessage message) throws WxErrorException
发送客服消息 详情请见: 发送客服消息 接口url格式:https://api.weixin.qq.com/cgi-bin/message/custom/send?access_token=ACCESS_TOKEN
message - the messageWxErrorException - 异常String sendKefuMessageWithResponse(WxMpKefuMessage message) throws WxErrorException
发送客服消息 详情请见: 发送客服消息 接口url格式:https://api.weixin.qq.com/cgi-bin/message/custom/send?access_token=ACCESS_TOKEN
message - the messageWxErrorException - 异常WxMpKfList kfList() throws WxErrorException
获取客服基本信息 详情请见:客服管理 接口url格式:https://api.weixin.qq.com/cgi-bin/customservice/getkflist?access_token=ACCESS_TOKEN
WxErrorException - 异常WxMpKfOnlineList kfOnlineList() throws WxErrorException
获取在线客服接待信息 详情请见:客服管理 接口url格式:https://api.weixin.qq.com/cgi-bin/customservice/getonlinekflist?access_token=ACCESS_TOKEN
WxErrorException - 异常boolean kfAccountAdd(WxMpKfAccountRequest request) throws WxErrorException
添加客服账号 详情请见:客服管理 接口url格式:https://api.weixin.qq.com/customservice/kfaccount/add?access_token=ACCESS_TOKEN
request - the requestWxErrorException - 异常boolean kfAccountUpdate(WxMpKfAccountRequest request) throws WxErrorException
设置客服信息(即更新客服信息) 详情请见:客服管理 接口url格式:https://api.weixin.qq.com/customservice/kfaccount/update?access_token=ACCESS_TOKEN
request - the requestWxErrorException - the wx error exceptionboolean kfAccountInviteWorker(WxMpKfAccountRequest request) throws WxErrorException
设置客服信息(即更新客服信息) 详情请见:客服管理 接口url格式:https://api.weixin.qq.com/customservice/kfaccount/inviteworker?access_token=ACCESS_TOKEN
request - the requestWxErrorException - 异常boolean kfAccountUploadHeadImg(String kfAccount, File imgFile) throws WxErrorException
上传客服头像 详情请见:客服管理 接口url格式:https://api.weixin.qq.com/customservice/kfaccount/uploadheadimg?access_token=ACCESS_TOKEN&kf_account=KFACCOUNT
kfAccount - the kf accountimgFile - the img fileWxErrorException - 异常boolean kfAccountDel(String kfAccount) throws WxErrorException
删除客服账号 详情请见:客服管理 接口url格式:https://api.weixin.qq.com/customservice/kfaccount/del?access_token=ACCESS_TOKEN&kf_account=KFACCOUNT
kfAccount - the kf accountWxErrorException - 异常boolean kfSessionCreate(String openid, String kfAccount) throws WxErrorException
创建会话 此接口在客服和用户之间创建一个会话,如果该客服和用户会话已存在,则直接返回0。指定的客服账号必须已经绑定微信号且在线。 详情请见:客服会话控制接口 接口url格式: https://api.weixin.qq.com/customservice/kfsession/create?access_token=ACCESS_TOKEN
openid - the openidkfAccount - the kf accountWxErrorException - 异常boolean kfSessionClose(String openid, String kfAccount) throws WxErrorException
关闭会话 开发者可以使用本接口,关闭一个会话。 详情请见:客服会话控制接口 接口url格式: https://api.weixin.qq.com/customservice/kfsession/close?access_token=ACCESS_TOKEN
openid - the openidkfAccount - the kf accountWxErrorException - 异常WxMpKfSessionGetResult kfSessionGet(String openid) throws WxErrorException
获取客户的会话状态 此接口获取一个客户的会话,如果不存在,则kf_account为空。 详情请见:客服会话控制接口 接口url格式: https://api.weixin.qq.com/customservice/kfsession/getsession?access_token=ACCESS_TOKEN&openid=OPENID
openid - the openidWxErrorException - 异常WxMpKfSessionList kfSessionList(String kfAccount) throws WxErrorException
获取客服的会话列表 开发者可以通过本接口获取某个客服正在接待的会话列表。 详情请见:客服会话控制 接口url格式: https://api.weixin.qq.com/customservice/kfsession/getsessionlist?access_token=ACCESS_TOKEN&kf_account=KFACCOUNT
kfAccount - the kf accountWxErrorException - 异常WxMpKfSessionWaitCaseList kfSessionGetWaitCase() throws WxErrorException
获取未接入会话列表 开发者可以通过本接口获取当前正在等待队列中的会话列表,此接口最多返回最早进入队列的100个未接入会话。 详情请见:客服会话控制 接口url格式: https://api.weixin.qq.com/customservice/kfsession/getwaitcase?access_token=ACCESS_TOKEN
WxErrorException - 异常WxMpKfMsgList kfMsgList(Date startTime, Date endTime, Long msgId, Integer number) throws WxErrorException
获取聊天记录(原始接口) 此接口返回的聊天记录中,对于图片、语音、视频,分别展示成文本格式的[image]、[voice]、[video] 详情请见:获取聊天记录 接口url格式: https://api.weixin.qq.com/customservice/msgrecord/getmsglist?access_token=ACCESS_TOKEN
startTime - 起始时间endTime - 结束时间msgId - 消息id顺序从小到大,从1开始number - 每次获取条数,最多10000条WxErrorException - 异常WxMpKfMsgList kfMsgList(Date startTime, Date endTime) throws WxErrorException
获取聊天记录(优化接口,返回指定时间段内所有的聊天记录) 此接口返回的聊天记录中,对于图片、语音、视频,分别展示成文本格式的[image]、[voice]、[video] 详情请见:获取聊天记录 接口url格式: https://api.weixin.qq.com/customservice/msgrecord/getmsglist?access_token=ACCESS_TOKEN
startTime - 起始时间endTime - 结束时间WxErrorException - 异常boolean sendKfTypingState(String openid, String command) throws WxErrorException
客服输入状态 开发者可通过调用“客服输入状态”接口,返回客服当前输入状态给用户。 此接口需要客服消息接口权限。 如果不满足发送客服消息的触发条件,则无法下发输入状态。 下发输入状态,需要客服之前30秒内跟用户有过消息交互。 在输入状态中(持续15s),不可重复下发输入态。 在输入状态中,如果向用户下发消息,会同时取消输入状态。 详情请见:客服输入状态 接口url格式:https://api.weixin.qq.com/cgi-bin/message/custom/typing?access_token=ACCESS_TOKEN
openid - 用户idcommand - "Typing":对用户下发“正在输入"状态 "CancelTyping":取消对用户的”正在输入"状态WxErrorException - 异常Copyright © 2024. All rights reserved.