mirror of
https://gitee.com/binary/weixin-java-tools.git
synced 2025-05-03 04:13:37 +08:00
🆕 #2825 【企业微信】增加分配在职成员的客户群的接口
This commit is contained in:
parent
65134bd1ca
commit
320bbfe7be
@ -595,6 +595,24 @@ public interface WxCpExternalContactService {
|
||||
*/
|
||||
WxCpUserExternalGroupChatTransferResp transferGroupChat(String[] chatIds, String newOwner) throws WxErrorException;
|
||||
|
||||
|
||||
/**
|
||||
* 企业可通过此接口,将在职成员为群主的群,分配给另一个客服成员。
|
||||
* <per>
|
||||
* 注意:
|
||||
* 继承给的新群主,必须是配置了客户联系功能的成员
|
||||
* 继承给的新群主,必须有设置实名
|
||||
* 继承给的新群主,必须有激活企业微信
|
||||
* 同一个人的群,限制每天最多分配300个给新群主
|
||||
* 为保障客户服务体验,90个自然日内,在职成员的每个客户群仅可被转接2次。
|
||||
* </pre>
|
||||
* @param chatIds 需要转群主的客户群ID列表。取值范围: 1 ~ 100
|
||||
* @param newOwner 新群主ID
|
||||
* @return 分配结果 ,主要是分配失败的群列表
|
||||
* @throws WxErrorException the wx error exception
|
||||
*/
|
||||
WxCpUserExternalGroupChatTransferResp onjobTransferGroupChat(String[] chatIds, String newOwner) throws WxErrorException;
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* 企业可通过此接口获取成员联系客户的数据,包括发起申请数、新增客户数、聊天数、发送消息数和删除/拉黑成员的客户数等指标。
|
||||
|
@ -373,6 +373,18 @@ public class WxCpExternalContactServiceImpl implements WxCpExternalContactServic
|
||||
return WxCpUserExternalGroupChatTransferResp.fromJson(result);
|
||||
}
|
||||
|
||||
@Override
|
||||
public WxCpUserExternalGroupChatTransferResp onjobTransferGroupChat(String[] chatIds, String newOwner) throws WxErrorException {
|
||||
JsonObject json = new JsonObject();
|
||||
if (ArrayUtils.isNotEmpty(chatIds)) {
|
||||
json.add("chat_id_list", new Gson().toJsonTree(chatIds).getAsJsonArray());
|
||||
}
|
||||
json.addProperty("new_owner", newOwner);
|
||||
final String url = this.mainService.getWxCpConfigStorage().getApiUrl(GROUP_CHAT_ONJOB_TRANSFER);
|
||||
final String result = this.mainService.post(url, json.toString());
|
||||
return WxCpUserExternalGroupChatTransferResp.fromJson(result);
|
||||
}
|
||||
|
||||
@Override
|
||||
public WxCpUserExternalUserBehaviorStatistic getUserBehaviorStatistic(Date startTime, Date endTime,
|
||||
String[] userIds, String[] partyIds) throws WxErrorException {
|
||||
|
@ -1054,6 +1054,10 @@ public interface WxCpApiPathConsts {
|
||||
* The constant GROUP_CHAT_TRANSFER.
|
||||
*/
|
||||
String GROUP_CHAT_TRANSFER = "/cgi-bin/externalcontact/groupchat/transfer";
|
||||
/**
|
||||
* The constant GROUP_CHAT_ONJOB_TRANSFER.
|
||||
*/
|
||||
String GROUP_CHAT_ONJOB_TRANSFER = "/cgi-bin/externalcontact/groupchat/onjob_transfer";
|
||||
/**
|
||||
* The constant LIST_USER_BEHAVIOR_DATA.
|
||||
*/
|
||||
|
@ -406,6 +406,19 @@ public class WxCpExternalContactServiceImplTest {
|
||||
assertNotNull(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test onjob transfer group chat.
|
||||
*
|
||||
* @throws WxErrorException the wx error exception
|
||||
*/
|
||||
@Test
|
||||
public void testOnjobTransferGroupChat() throws WxErrorException {
|
||||
String[] str = {"wrHlLKQAAAFbfB99-BO97YZlcywznGZg", "error_group_id"};
|
||||
WxCpUserExternalGroupChatTransferResp result = this.wxCpService.getExternalContactService().onjobTransferGroupChat(str
|
||||
, "x");
|
||||
System.out.println(result);
|
||||
assertNotNull(result);
|
||||
}
|
||||
/**
|
||||
* Test get user behavior statistic.
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user