com.foxinmy.weixin4j.mp.api
Class CustomApi

java.lang.Object
  extended by com.foxinmy.weixin4j.api.BaseApi
      extended by com.foxinmy.weixin4j.mp.api.MpApi
          extended by com.foxinmy.weixin4j.mp.api.CustomApi

public class CustomApi
extends MpApi

多客服API

Since:
JDK 1.6
Author:
jinyu(foxinmy@gmail.com)
See Also:
多客服说明

Constructor Summary
CustomApi(TokenManager tokenManager)
           
 
Method Summary
 ApiResult closeKfSession(String userOpenId, String kfAccount, String text)
          关闭会话
 ApiResult createKfAccount(String id, String name, String pwd)
          新增客服账号
 ApiResult createKfSession(String userOpenId, String kfAccount, String text)
          创建会话
 ApiResult deleteKfAccount(String id)
          删除客服账号
 List<KfChatRecord> getKfChatRecord(Date startTime, Date endTime, int number)
          客服聊天记录
 KfSession getKfSession(String userOpenId)
          获取客户的会话状态:获取客户当前的会话状态。
 ApiResult inviteKfAccount(String kfAccount, String inviteAccount)
          邀请绑定客服帐号 新添加的客服帐号是不能直接使用的,只有客服人员用微信号绑定了客服账号后,方可登录Web客服进行操作。此接口发起一个绑定邀请到客服人员微信号 ,客服人员需要在微信客户端上用该微信号确认后帐号才可用。尚未绑定微信号的帐号可以进行绑定邀请操作,邀请未失效时不能对该帐号进行再次绑定微信号邀请。
 List<KfAccount> listKfAccount()
          获取公众号中所设置的客服基本信息,包括客服工号、客服昵称、客服登录账号
 List<KfSession> listKfSession(String kfAccount)
          获取客服的会话列表:获取某个客服正在接待的会话列表。
 KfSession.KfSessionCounter listKfWaitSession()
          获取未接入会话列表:获取当前正在等待队列中的会话列表,此接口最多返回最早进入队列的100个未接入会话。
缺陷:没有count字段
 List<KfOnlineAccount> listOnlineKfAccount()
          获取在线客服在线状态(手机在线、PC客户端在线、手机和PC客户端全都在线)、客服自动接入最大值、 客服当前接待客户数
 ApiResult updateKfAccount(String id, String name, String pwd)
          更新客服账号
 ApiResult uploadKfAvatar(String accountId, InputStream is, String fileName)
          上传客服头像
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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,
                                 String pwd)
                          throws WeixinException
新增客服账号

Parameters:
id - 完整客服账号,格式为:账号前缀@公众号微信号,账号前缀最多10个字符,必须是英文或者数字字符。如果没有公众号微信号, 请前往微信公众平台设置。
name - 客服昵称,最长6个汉字或12个英文字符
pwd - 客服账号登录密码
Returns:
处理结果
Throws:
WeixinException
See Also:
新增客服账号

updateKfAccount

public ApiResult updateKfAccount(String id,
                                 String name,
                                 String pwd)
                          throws WeixinException
更新客服账号

Parameters:
id - 完整客服账号,格式为:账号前缀@公众号微信号,账号前缀最多10个字符,必须是英文或者数字字符。如果没有公众号微信号, 请前往微信公众平台设置。
name - 客服昵称,最长6个汉字或12个英文字符
pwd - 客服账号登录密码
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 - 用户的userOpenId
kfAccount - 完整客服账号,格式为:账号前缀@公众号微信号
text - 附加信息,文本会展示在客服人员的多客服客户端
Returns:
处理结果
Throws:
WeixinException
See Also:
创建会话

closeKfSession

public ApiResult closeKfSession(String userOpenId,
                                String kfAccount,
                                String text)
                         throws WeixinException
关闭会话

Parameters:
userOpenId - 用户的userOpenId
kfAccount - 完整客服账号,格式为:账号前缀@公众号微信号
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, 获取客服的会话列表


Copyright © 2014–2017. All rights reserved.