11package me .chanjar .weixin .mp .api ;
22
3+ import java .io .File ;
4+ import java .util .Date ;
5+
36import me .chanjar .weixin .common .error .WxErrorException ;
47import me .chanjar .weixin .mp .bean .kefu .WxMpKefuMessage ;
58import me .chanjar .weixin .mp .bean .kefu .request .WxMpKfAccountRequest ;
6- import me .chanjar .weixin .mp .bean .kefu .result .*;
7-
8- import java .io .File ;
9- import java .util .Date ;
9+ import me .chanjar .weixin .mp .bean .kefu .result .WxMpKfList ;
10+ import me .chanjar .weixin .mp .bean .kefu .result .WxMpKfMsgList ;
11+ import me .chanjar .weixin .mp .bean .kefu .result .WxMpKfOnlineList ;
12+ import me .chanjar .weixin .mp .bean .kefu .result .WxMpKfSessionGetResult ;
13+ import me .chanjar .weixin .mp .bean .kefu .result .WxMpKfSessionList ;
14+ import me .chanjar .weixin .mp .bean .kefu .result .WxMpKfSessionWaitCaseList ;
1015
1116/**
1217 * <pre>
13- * 客服接口 ,
18+ * 客服接口.
1419 * 注意:命名采用kefu拼音的原因是:其英文CustomerService如果再加上Service后缀显得有点啰嗦,如果不加又显得表意不完整。
1520 * </pre>
1621 *
@@ -30,14 +35,17 @@ public interface WxMpKefuService {
3035 String KFSESSION_GET_SESSION = "https://api.weixin.qq.com/customservice/kfsession/getsession?openid=%s" ;
3136 String KFSESSION_GET_SESSION_LIST = "https://api.weixin.qq.com/customservice/kfsession/getsessionlist?kf_account=%s" ;
3237 String KFSESSION_GET_WAIT_CASE = "https://api.weixin.qq.com/customservice/kfsession/getwaitcase" ;
33- String MSGRECORD_GET_MSG_LIST = "https://api.weixin.qq.com/customservice/msgrecord/getmsglist" ;
38+ String MSG_RECORD_LIST = "https://api.weixin.qq.com/customservice/msgrecord/getmsglist" ;
39+ String CUSTOM_TYPING = "https://api.weixin.qq.com/cgi-bin/message/custom/typing" ;
3440
3541 /**
3642 * <pre>
3743 * 发送客服消息
3844 * 详情请见: <a href="http://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1421140547&token=&lang=zh_CN">发送客服消息</a>
3945 * 接口url格式:https://api.weixin.qq.com/cgi-bin/message/custom/send?access_token=ACCESS_TOKEN
4046 * </pre>
47+ *
48+ * @throws WxErrorException 异常
4149 */
4250 boolean sendKefuMessage (WxMpKefuMessage message ) throws WxErrorException ;
4351
@@ -49,6 +57,8 @@ public interface WxMpKefuService {
4957 * 详情请见:<a href="http://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1458044813&token=&lang=zh_CN">客服管理</a>
5058 * 接口url格式:https://api.weixin.qq.com/cgi-bin/customservice/getkflist?access_token=ACCESS_TOKEN
5159 * </pre>
60+ *
61+ * @throws WxErrorException 异常
5262 */
5363 WxMpKfList kfList () throws WxErrorException ;
5464
@@ -58,6 +68,8 @@ public interface WxMpKefuService {
5868 * 详情请见:<a href="http://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1458044813&token=&lang=zh_CN">客服管理</a>
5969 * 接口url格式:https://api.weixin.qq.com/cgi-bin/customservice/getonlinekflist?access_token=ACCESS_TOKEN
6070 * </pre>
71+ *
72+ * @throws WxErrorException 异常
6173 */
6274 WxMpKfOnlineList kfOnlineList () throws WxErrorException ;
6375
@@ -67,6 +79,8 @@ public interface WxMpKefuService {
6779 * 详情请见:<a href="http://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1458044813&token=&lang=zh_CN">客服管理</a>
6880 * 接口url格式:https://api.weixin.qq.com/customservice/kfaccount/add?access_token=ACCESS_TOKEN
6981 * </pre>
82+ *
83+ * @throws WxErrorException 异常
7084 */
7185 boolean kfAccountAdd (WxMpKfAccountRequest request ) throws WxErrorException ;
7286
@@ -85,6 +99,8 @@ public interface WxMpKefuService {
8599 * 详情请见:<a href="http://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1458044813&token=&lang=zh_CN">客服管理</a>
86100 * 接口url格式:https://api.weixin.qq.com/customservice/kfaccount/inviteworker?access_token=ACCESS_TOKEN
87101 * </pre>
102+ *
103+ * @throws WxErrorException 异常
88104 */
89105 boolean kfAccountInviteWorker (WxMpKfAccountRequest request ) throws WxErrorException ;
90106
@@ -94,15 +110,19 @@ public interface WxMpKefuService {
94110 * 详情请见:<a href="http://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1458044813&token=&lang=zh_CN">客服管理</a>
95111 * 接口url格式:https://api.weixin.qq.com/customservice/kfaccount/uploadheadimg?access_token=ACCESS_TOKEN&kf_account=KFACCOUNT
96112 * </pre>
113+ *
114+ * @throws WxErrorException 异常
97115 */
98- boolean kfAccountUploadHeadImg (String kfAccount , File imgFile ) throws WxErrorException ;
116+ boolean kfAccountUploadHeadImg (String kfAccount , File imgFile ) throws WxErrorException ;
99117
100118 /**
101119 * <pre>
102120 * 删除客服账号
103121 * 详情请见:<a href="http://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1458044813&token=&lang=zh_CN">客服管理</a>
104122 * 接口url格式:https://api.weixin.qq.com/customservice/kfaccount/del?access_token=ACCESS_TOKEN&kf_account=KFACCOUNT
105123 * </pre>
124+ *
125+ * @throws WxErrorException 异常
106126 */
107127 boolean kfAccountDel (String kfAccount ) throws WxErrorException ;
108128
@@ -115,6 +135,8 @@ public interface WxMpKefuService {
115135 * 详情请见:<a href="http://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1458044820&token=&lang=zh_CN">客服会话控制接口</a>
116136 * 接口url格式: https://api.weixin.qq.com/customservice/kfsession/create?access_token=ACCESS_TOKEN
117137 * </pre>
138+ *
139+ * @throws WxErrorException 异常
118140 */
119141 boolean kfSessionCreate (String openid , String kfAccount ) throws WxErrorException ;
120142
@@ -125,6 +147,8 @@ public interface WxMpKefuService {
125147 * 详情请见:<a href="http://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1458044820&token=&lang=zh_CN">客服会话控制接口</a>
126148 * 接口url格式: https://api.weixin.qq.com/customservice/kfsession/close?access_token=ACCESS_TOKEN
127149 * </pre>
150+ *
151+ * @throws WxErrorException 异常
128152 */
129153 boolean kfSessionClose (String openid , String kfAccount ) throws WxErrorException ;
130154
@@ -135,6 +159,8 @@ public interface WxMpKefuService {
135159 * 详情请见:<a href="http://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1458044820&token=&lang=zh_CN">客服会话控制接口</a>
136160 * 接口url格式: https://api.weixin.qq.com/customservice/kfsession/getsession?access_token=ACCESS_TOKEN&openid=OPENID
137161 * </pre>
162+ *
163+ * @throws WxErrorException 异常
138164 */
139165 WxMpKfSessionGetResult kfSessionGet (String openid ) throws WxErrorException ;
140166
@@ -145,6 +171,8 @@ public interface WxMpKefuService {
145171 * 详情请见:<a href="http://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1458044820&token=&lang=zh_CN">客服会话控制</a>
146172 * 接口url格式: https://api.weixin.qq.com/customservice/kfsession/getsessionlist?access_token=ACCESS_TOKEN&kf_account=KFACCOUNT
147173 * </pre>
174+ *
175+ * @throws WxErrorException 异常
148176 */
149177 WxMpKfSessionList kfSessionList (String kfAccount ) throws WxErrorException ;
150178
@@ -155,6 +183,8 @@ public interface WxMpKefuService {
155183 * 详情请见:<a href="http://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1458044820&token=&lang=zh_CN">客服会话控制</a>
156184 * 接口url格式: https://api.weixin.qq.com/customservice/kfsession/getwaitcase?access_token=ACCESS_TOKEN
157185 * </pre>
186+ *
187+ * @throws WxErrorException 异常
158188 */
159189 WxMpKfSessionWaitCaseList kfSessionGetWaitCase () throws WxErrorException ;
160190
@@ -173,7 +203,7 @@ public interface WxMpKefuService {
173203 * @param msgId 消息id顺序从小到大,从1开始
174204 * @param number 每次获取条数,最多10000条
175205 * @return 聊天记录对象
176- * @throws WxErrorException
206+ * @throws WxErrorException 异常
177207 */
178208 WxMpKfMsgList kfMsgList (Date startTime , Date endTime , Long msgId , Integer number ) throws WxErrorException ;
179209
@@ -188,8 +218,27 @@ public interface WxMpKefuService {
188218 * @param startTime 起始时间
189219 * @param endTime 结束时间
190220 * @return 聊天记录对象
191- * @throws WxErrorException
221+ * @throws WxErrorException 异常
192222 */
193223 WxMpKfMsgList kfMsgList (Date startTime , Date endTime ) throws WxErrorException ;
194224
225+ /**
226+ * <pre>
227+ * 客服输入状态
228+ * 开发者可通过调用“客服输入状态”接口,返回客服当前输入状态给用户。
229+ * 此接口需要客服消息接口权限。
230+ * 如果不满足发送客服消息的触发条件,则无法下发输入状态。
231+ * 下发输入状态,需要客服之前30秒内跟用户有过消息交互。
232+ * 在输入状态中(持续15s),不可重复下发输入态。
233+ * 在输入状态中,如果向用户下发消息,会同时取消输入状态。
234+ *
235+ * 详情请见:<a href="https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1421140547">客服输入状态</a>
236+ * 接口url格式:https://api.weixin.qq.com/cgi-bin/message/custom/typing?access_token=ACCESS_TOKEN
237+ * </pre>
238+ *
239+ * @param openid 用户id
240+ * @param command "Typing":对用户下发“正在输入"状态 "CancelTyping":取消对用户的”正在输入"状态
241+ * @throws WxErrorException 异常
242+ */
243+ boolean sendKfTypingState (String openid , String command ) throws WxErrorException ;
195244}
0 commit comments