public interface WxCpKfService
| 限定符和类型 | 方法和说明 |
|---|---|
WxCpKfAccountAddResp |
addAccount(WxCpKfAccountAdd add)
添加客服帐号,并可设置客服名称和头像。
|
WxCpKfServicerOpResp |
addServicer(String openKfid,
List<String> userIdList)
接待人员管理
添加指定客服帐号的接待人员,每个客服帐号目前最多可添加500个接待人员。
|
WxCpKfCustomerBatchGetResp |
customerBatchGet(List<String> externalUserIdList)
获取客户基础信息
|
WxCpBaseResp |
delAccount(WxCpKfAccountDel del)
删除已有的客服帐号
|
WxCpKfServicerOpResp |
delServicer(String openKfid,
List<String> userIdList)
接待人员管理
从客服帐号删除接待人员
|
WxCpKfAccountLinkResp |
getAccountLink(WxCpKfAccountLink link)
企业可通过此接口获取带有不同参数的客服链接,不同客服帐号对应不同的客服链接。
|
WxCpKfServiceStateResp |
getServiceState(String openKfid,
String externalUserId)
分配客服会话
获取会话状态
|
WxCpKfAccountListResp |
listAccount()
获取客服帐号列表,包括所有的客服帐号的客服ID、名称和头像。
|
WxCpKfServicerListResp |
listServicer(String openKfid)
接待人员管理
获取某个客服帐号的接待人员列表
|
WxCpKfMsgSendResp |
sendMsg(WxCpKfMsgSendRequest request)
发送消息
当微信客户处于“新接入待处理”或“由智能助手接待”状态下,可调用该接口给用户发送消息。
|
WxCpKfMsgSendResp |
sendMsgOnEvent(WxCpKfMsgSendRequest request)
发送欢迎语等事件响应消息
当特定的事件回调消息包含code字段,或通过接口变更到特定的会话状态,会返回code字段。
|
WxCpKfMsgListResp |
syncMsg(String cursor,
String token,
Integer limit,
Integer voiceFormat)
读取消息
微信客户发送的消息、接待人员在企业微信回复的消息、发送消息接口发送失败事件(如被用户拒收)、客户点击菜单消息的回复消息,
可以通过该接口获取具体的消息内容和事件。
|
WxCpKfServiceStateTransResp |
transServiceState(String openKfid,
String externalUserId,
Integer serviceState,
String servicerUserId)
分配客服会话
变更会话状态
|
WxCpBaseResp |
updAccount(WxCpKfAccountUpd upd)
修改已有的客服帐号,可修改客服名称和头像。
|
WxCpKfAccountAddResp addAccount(WxCpKfAccountAdd add) throws WxErrorException
add - 客服帐号信息WxErrorException - 异常WxCpBaseResp updAccount(WxCpKfAccountUpd upd) throws WxErrorException
upd - 新的客服账号信息WxErrorException - 异常WxCpBaseResp delAccount(WxCpKfAccountDel del) throws WxErrorException
del - 要删除的客服帐号WxErrorException - 异常WxCpKfAccountListResp listAccount() throws WxErrorException
WxErrorException - 异常WxCpKfAccountLinkResp getAccountLink(WxCpKfAccountLink link) throws WxErrorException
link - 参数WxErrorException - 异常WxCpKfServicerOpResp addServicer(String openKfid, List<String> userIdList) throws WxErrorException
openKfid - 客服帐号IDuserIdList - 接待人员userid列表。第三方应用填密文userid,即open_userid
可填充个数:1 ~ 100。超过100个需分批调用。WxErrorException - 异常WxCpKfServicerOpResp delServicer(String openKfid, List<String> userIdList) throws WxErrorException
openKfid - 客服帐号IDuserIdList - 接待人员userid列表。第三方应用填密文userid,即open_userid
可填充个数:1 ~ 100。超过100个需分批调用。WxErrorException - 异常WxCpKfServicerListResp listServicer(String openKfid) throws WxErrorException
openKfid - 客服帐号IDWxErrorException - 异常WxCpKfServiceStateResp getServiceState(String openKfid, String externalUserId) throws WxErrorException
openKfid - 客服帐号IDexternalUserId - 微信客户的external_useridWxErrorExceptionWxCpKfServiceStateTransResp transServiceState(String openKfid, String externalUserId, Integer serviceState, String servicerUserId) throws WxErrorException
openKfid - 客服帐号IDexternalUserId - 微信客户的external_useridserviceState - 变更的目标状态,状态定义和所允许的变更可参考概述中的流程图和表格servicerUserId - 接待人员的userid。第三方应用填密文userid,即open_userid。当state=3时要求必填,接待人员须处于“正在接待”中。WxErrorExceptionWxCpKfMsgListResp syncMsg(String cursor, String token, Integer limit, Integer voiceFormat) throws WxErrorException
cursor - 上一次调用时返回的next_cursor,第一次拉取可以不填。不多于64字节token - 回调事件返回的token字段,10分钟内有效;可不填,如果不填接口有严格的频率限制。不多于128字节limit - 期望请求的数据量,默认值和最大值都为1000。
注意:可能会出现返回条数少于limit的情况,需结合返回的has_more字段判断是否继续请求。voiceFormat - 语音消息类型,0-Amr 1-Silk,默认0。可通过该参数控制返回的语音格式WxErrorException - 异常WxCpKfMsgSendResp sendMsg(WxCpKfMsgSendRequest request) throws WxErrorException
request - 发送信息WxErrorException - 异常WxCpKfMsgSendResp sendMsgOnEvent(WxCpKfMsgSendRequest request) throws WxErrorException
request - WxErrorExceptionWxCpKfCustomerBatchGetResp customerBatchGet(List<String> externalUserIdList) throws WxErrorException
externalUserIdList - WxErrorExceptionCopyright © 2022. All rights reserved.