Skip to content

支持接口:分配在职成员的客户群 #2825

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -595,6 +595,24 @@ WxCpUserExternalGroupChatList listGroupChat(Integer pageIndex, Integer pageSize,
*/
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>
* 企业可通过此接口获取成员联系客户的数据,包括发起申请数、新增客户数、聊天数、发送消息数和删除/拉黑成员的客户数等指标。
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,18 @@ public WxCpUserExternalGroupChatTransferResp transferGroupChat(String[] chatIds,
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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1054,6 +1054,10 @@ interface ExternalContact {
* 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.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,19 @@ public void testTransferGroupChat() throws WxErrorException {
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.
*/
Expand Down