🆕 #2825 【企业微信】增加分配在职成员的客户群的接口

This commit is contained in:
xslong 2022-09-26 23:06:42 +08:00 committed by GitHub
parent 65134bd1ca
commit 320bbfe7be
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 47 additions and 0 deletions

View File

@ -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>
* 企业可通过此接口获取成员联系客户的数据包括发起申请数新增客户数聊天数发送消息数和删除/拉黑成员的客户数等指标

View File

@ -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 {

View File

@ -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.
*/

View File

@ -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.
*/