Package com.foxinmy.weixin4j.mp.api
Class CustomApi
- java.lang.Object
-
- com.foxinmy.weixin4j.api.BaseApi
-
- com.foxinmy.weixin4j.mp.api.MpApi
-
- com.foxinmy.weixin4j.mp.api.CustomApi
-
-
Field Summary
-
Fields inherited from class com.foxinmy.weixin4j.api.BaseApi
weixinExecutor
-
-
Constructor Summary
Constructors Constructor Description CustomApi(TokenManager tokenManager)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ApiResultcloseKfSession(String userOpenId, String kfAccount, String text)关闭会话ApiResultcreateKfAccount(String id, String name)新增客服账号ApiResultcreateKfSession(String userOpenId, String kfAccount, String text)创建会话ApiResultdeleteKfAccount(String id)删除客服账号List<KfChatRecord>getKfChatRecord(Date startTime, Date endTime, int number)客服聊天记录KfSessiongetKfSession(String userOpenId)获取客户的会话状态:获取客户当前的会话状态。ApiResultinviteKfAccount(String kfAccount, String inviteAccount)邀请绑定客服帐号 新添加的客服帐号是不能直接使用的,只有客服人员用微信号绑定了客服账号后,方可登录Web客服进行操作。此接口发起一个绑定邀请到客服人员微信号 ,客服人员需要在微信客户端上用该微信号确认后帐号才可用。尚未绑定微信号的帐号可以进行绑定邀请操作,邀请未失效时不能对该帐号进行再次绑定微信号邀请。List<KfAccount>listKfAccount()获取公众号中所设置的客服基本信息,包括客服工号、客服昵称、客服登录账号List<KfSession>listKfSession(String kfAccount)获取客服的会话列表:获取某个客服正在接待的会话列表。KfSession.KfSessionCounterlistKfWaitSession()获取未接入会话列表:获取当前正在等待队列中的会话列表,此接口最多返回最早进入队列的100个未接入会话。 缺陷:没有count字段List<KfOnlineAccount>listOnlineKfAccount()获取在线客服在线状态(手机在线、PC客户端在线、手机和PC客户端全都在线)、客服自动接入最大值、 客服当前接待客户数ApiResultupdateKfAccount(String id, String name)更新客服账号ApiResultuploadKfAvatar(String accountId, InputStream is, String fileName)上传客服头像-
Methods inherited from class com.foxinmy.weixin4j.mp.api.MpApi
weixinBundle
-
Methods inherited from class com.foxinmy.weixin4j.api.BaseApi
getRequestUri
-
-
-
-
Constructor Detail
-
CustomApi
public CustomApi(TokenManager tokenManager)
-
-
Method Detail
-
getKfChatRecord
public List<KfChatRecord> getKfChatRecord(Date startTime, Date endTime, int number) throws WeixinException
客服聊天记录- Parameters:
startTime- 查询开始时间endTime- 查询结束时间 每次查询不能跨日查询number- 最多10000条- Throws:
WeixinException- See Also:
KfChatRecord, 查询客服聊天记录, 查询客服聊天记录
-
listKfAccount
public List<KfAccount> listKfAccount() throws WeixinException
获取公众号中所设置的客服基本信息,包括客服工号、客服昵称、客服登录账号- Returns:
- 多客服信息列表
- Throws:
WeixinException- See Also:
KfAccount, 获取客服基本信息
-
listOnlineKfAccount
public List<KfOnlineAccount> listOnlineKfAccount() throws WeixinException
获取在线客服在线状态(手机在线、PC客户端在线、手机和PC客户端全都在线)、客服自动接入最大值、 客服当前接待客户数- Returns:
- 多客服在线信息列表
- Throws:
WeixinException- See Also:
KfOnlineAccount, 获取客服在线信息
-
createKfAccount
public ApiResult createKfAccount(String id, String name) throws WeixinException
新增客服账号- Parameters:
id- 完整客服账号,格式为:账号前缀@公众号微信号,账号前缀最多10个字符,必须是英文或者数字字符。如果没有公众号微信号, 请前往微信公众平台设置。name- 客服昵称,最长6个汉字或12个英文字符- Returns:
- 处理结果
- Throws:
WeixinException- See Also:
- 新增客服账号
-
updateKfAccount
public ApiResult updateKfAccount(String id, String name) throws WeixinException
更新客服账号- Parameters:
id- 完整客服账号,格式为:账号前缀@公众号微信号,账号前缀最多10个字符,必须是英文或者数字字符。如果没有公众号微信号, 请前往微信公众平台设置。name- 客服昵称,最长6个汉字或12个英文字符- Returns:
- 处理结果
- Throws:
WeixinException- See Also:
- 新增客服账号
-
inviteKfAccount
public ApiResult inviteKfAccount(String kfAccount, String inviteAccount) throws WeixinException
邀请绑定客服帐号 新添加的客服帐号是不能直接使用的,只有客服人员用微信号绑定了客服账号后,方可登录Web客服进行操作。此接口发起一个绑定邀请到客服人员微信号 ,客服人员需要在微信客户端上用该微信号确认后帐号才可用。尚未绑定微信号的帐号可以进行绑定邀请操作,邀请未失效时不能对该帐号进行再次绑定微信号邀请。- Parameters:
kfAccount- 完整客服帐号,格式为:帐号前缀@公众号微信号inviteAccount- 接收绑定邀请的客服微信号- Returns:
- 处理结果
- Throws:
WeixinException- See Also:
- 邀请绑定客服帐号
-
uploadKfAvatar
public ApiResult uploadKfAvatar(String accountId, InputStream is, String fileName) throws WeixinException
上传客服头像- Parameters:
accountId- 完整客服账号,格式为:账号前缀@公众号微信号is- 头像图片文件必须是jpg格式,推荐使用640*640大小的图片以达到最佳效果fileName- 文件名 为空时将自动生成- Returns:
- 处理结果
- Throws:
WeixinException- See Also:
- 上传客服头像
-
deleteKfAccount
public ApiResult deleteKfAccount(String id) throws WeixinException
删除客服账号- Parameters:
id- 完整客服账号,格式为:账号前缀@公众号微信号- Returns:
- 处理结果
- Throws:
WeixinException- See Also:
- 删除客服账号
-
createKfSession
public ApiResult createKfSession(String userOpenId, String kfAccount, String text) throws WeixinException
创建会话开发者可以使用本接口,为多客服的客服工号创建会话,将某个客户直接指定给客服工号接待,需要注意此接口不会受客服自动接入数以及自动接入开关限制。 只能为在线的客服(PC客户端在线,或者已绑定多客服助手)创建会话。
- Parameters:
userOpenId- 用户的userOpenIdkfAccount- 完整客服账号,格式为:账号前缀@公众号微信号text- 附加信息,文本会展示在客服人员的多客服客户端- Returns:
- 处理结果
- Throws:
WeixinException- See Also:
- 创建会话
-
closeKfSession
public ApiResult closeKfSession(String userOpenId, String kfAccount, String text) throws WeixinException
关闭会话- Parameters:
userOpenId- 用户的userOpenIdkfAccount- 完整客服账号,格式为:账号前缀@公众号微信号text- 附加信息,文本会展示在客服人员的多客服客户端- Returns:
- 处理结果
- Throws:
WeixinException- See Also:
- 关闭会话
-
getKfSession
public KfSession getKfSession(String userOpenId) throws WeixinException
获取客户的会话状态:获取客户当前的会话状态。- Parameters:
userOpenId- 用户的openid- Returns:
- 会话对象
- Throws:
WeixinException- See Also:
KfSession, 获取会话状态
-
listKfSession
public List<KfSession> listKfSession(String kfAccount) throws WeixinException
获取客服的会话列表:获取某个客服正在接待的会话列表。- Parameters:
kfAccount- 完整客服账号,格式为:账号前缀@公众号微信号,账号前缀最多10个字符,必须是英文或者数字字符。- Returns:
- 会话列表
- Throws:
WeixinException- See Also:
KfSession, 获取客服的会话列表
-
listKfWaitSession
public KfSession.KfSessionCounter listKfWaitSession() throws WeixinException
获取未接入会话列表:获取当前正在等待队列中的会话列表,此接口最多返回最早进入队列的100个未接入会话。 缺陷:没有count字段- Returns:
- 会话列表
- Throws:
WeixinException- See Also:
KfSession,KfSession.KfSessionCounter, 获取客服的会话列表
-
-