主题
消息发送接口2.0
这个消息接口会返回msgId,后续可以通过msgId查询消息状态 对于字符串类型的参数的长度,这一篇中的都是字节长度,如果没有特殊说明,中文算3个字节,英文一个字节。例如urldesc这个字段,长度是1024,那么最多只能传341个汉字或者1024个英文字符。
接口说明
请求URL:http[s]://{网关地址}/mp/restful/v2/message/send
请求方式: POST
请求内容类型: application/json
响应内容类型: application/json
请求说明
请求体
| 字段名 | 参数名 | 必填 | 类型 | 描述 |
|---|---|---|---|---|
| 签名 | sign | M | String | 请求签名:(accessToken + 第一个receivers 的userID )的32位小写的MD5加密值,其中如果相应部分没有则忽略 |
| 消息类型 | msgType | O | String | 0: 普通消息(默认) 1: 必读消息 2: 验证码(为验证码时消息一定不入收件箱) |
| 截止时间 | expiredTime | *M | String | 当msgType 为1必读消息 ,该字段为必填字段 格式:yyyy-MM-dd HH:mm:ss |
| 消息主题 | subject | O | String | 消息主题 |
| 消息内容 | content | M | String | 消息内容 |
| 链接url描述 | urlDesc | O | String(1024) | Url链接的描述(中文算3个英文算一个) |
| PC链接url | pcUrl | O | String(2048) | pc端点击消息时的链接url(中文算3个英文算一个) |
| 链接url | mobileUrl | O | String(2048) | 手机端点击消息时的链接url (中文算3个英文算一个) |
| 消息发送类型 | sendType | O | String | 发送方式: 0.PC门户通知和移动校园同时发送(通常为此种方式) 1.只发送PC门户 2.只发送移动校园 3邮件 4短信 5微信企业号 6钉钉企业内部应用工作通知 7 微信服务号 8welink 如果不传入该参数,通道选择优先级为: 用户指定的通道>应用设定的模板通道(匹配到模板)> 接口传参通道 > 应用设定的默认通道 > 系统设定的全局通道 |
| wxSendType | O | String | 当发送类型为5时此字段才会生效:text(文本消息)、textcard(文本卡片)、news(图文卡片,如果图文,则qyWeChatImgUrl必填)、button(按钮卡片详见示例),不传默认为text | |
| 钉钉消息类型 | dingSendType | O | String | 当发送类型为6时此字段才会生效,此字段值为必须为:text(文本消息)、action_card(文本卡片)、image_news(图文消息,如果图文,则dingTalkImgUrl必填),link(链接,dingTalkImgUrl必填)),markdown(markdown)不传默认为text |
| 今日校园发送类型 | campusSendType | O | string | push(push消息类型),不填或者其他的就是普通的今日校园app消息, |
| 接收者类型 | receiverType | O | String | 1:用户2:用户组3:部门,默认为1 |
| 消息接收人 | receivers | *M | List<Receiver> | reveiverType为1时,必填,具体参数参照Receiver |
| 用户组ID列表 | groups | *M | List<String> | reveiverType为2时,用户组ID列表必填 |
| 用户部门ID列表 | departments | *M | List<String> | reveiverType为2时,部门ID列表 |
| 企业微信的图片地址 | qyWeChatImgUrl | *M | String(2048) | 企业微信是图文消息时这个字段必填,url通过1.4上传图片接口上传,或者可以自己上传公网可以访问的图片地址 |
| 钉钉图文的图片地址 | dingTalkImgUrl | *M | String(2048) | 钉钉图文消息或者链接消息时这个字段必填,url通过1.4上传图片接口上传,或者可以自己上传公网可以访问的图片地址 |
| 是否支持邮件抄送密送 | isMailCopy | O | int | 是否支持邮件抄送密送: 1是 此时发送类型只能为邮件 0:否 |
| 抄送人 | cc | O | List<Receiver> | 只有开启邮件抄送密送才有效 |
| 密送 | bcc | O | List<Receiver> | 只有开启邮件抄送密送才有效 |
| 附件id | attachments | O | [List<String(32) >] | 附件id,查看附件上传接口 |
| 用户指定的发送通道列表 | sendChannels | O | List<String> | 根据调用 查看通道列表 接口获取返回的通道的wid,来指定发送的通道,优先级最高 |
| 透传给通道的额外参数 | extParams | O | Map<String,String> | 透传给通道的额外的参数 |
| 用户组和组织机构的类型 | orgAndGroupObjectScope | O | int | 1:校内 2校外 默认不填写为校内 3.6.1.Beta2+ |
| 字段名 | 参数名 | 是否必填 | 类型 | 描述 |
|---|---|---|---|---|
| userId | userId | M | String(128) | 收件人的userId(职工号或学号)(中文算3个英文算一个) |
| mobile | mobile | O | String(20) | 手机号 (中文算3个英文算一个) |
| O | String(300) | 邮箱地址 (中文算3个英文算一个) | ||
| objectScope | objectScope | O | int | 1:校内 2校外 默认不填写为校内 3.6.1.Beta2+ |
请求示例
使用发送方式
json
{
"sign": "8a2a4eaf20a7d755fd68126d4bb160dd",
"subject": "1111",
"content": "7777",
"pcUrl": "http://www.baidu.com",
"mobileUrl": "http://wap.baidu.com",
"urlDesc": "查看详情",
"sendType": "123",
"receiverType": 1,
"receivers": [
{
"userId": "ampadmin",
"mobile": "18013838996",
"email": "whqiao@wisedu.com"
}
],
"extParams":{
"key":"value",
"paramKey2":"111"
}
}1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
企业微信按钮卡片消息示例(返回)
{
"sign": "{{sign}}", //请求签名:accessToken +[第1个userID] 的MD5值 如果receiverType是2或者3,直接accessTokenMd5
"msgType":"0",//0: 普通消息(默认)1: 必读消息2: 验证码(为验证码时消息一定不入收件箱)
"subject": "<a>202306071440</a>",
"content": "01111234",
"pcUrl": "http://172.16.34.93:8091/router/systemConfig/messageCenter/channelManager",
// "mobileUrl": "http://wap.baidu.com",
"urlDesc": "详情",
"sendType": "5",//发送方式: 0.PC门户通知和移动校园同时发送(通常为此种方式) 1.只发送PC门户 2.只发送移动校园 3邮件 4短信 5微信企业号 6钉钉企业内部应用工作通知7 微信服务号
"wxSendType":"button",//当发送类型为5时此字段才会生效:text(文本消息)、textcard(文本卡片)不传默认为text
"sendNow": "true",
"receiverType": "1",//1:用户2:用户组3:部门
"receivers": [//reveiverType为1时,必填,具体参数参照receivers
{
"userId": "{{userId}}",
"mobile": "手机号",
"email": "xxx@wisedu.com"
}
],
"extParams":{
"qiYeWeChatButton": " { \"card_type\" : \"button_interaction\", \"source\" : { \"icon_url\": \"http://caspportal.wisedu.com/oss/appIcon/mc/attachment/665153739965440.jpg?sign=p6UF9k-_HSo2HXlyhGjp7PVu1BJCBQxseCsDtzGNKGLcymQHWGOgpCIKGa-qKTFa\", \"desc\": \"企业微信\", \"desc_color\": 1 }, \"action_menu\": { \"desc\": \"卡片副交互辅助文本说明\", \"action_list\": [ {\"text\": \"接受推送\", \"key\": \"A\"}, {\"text\": \"不再推送\", \"key\": \"B\"} ] }, \"main_title\" : { \"title\" : \"欢迎使用企业微信\", \"desc\" : \"您的好友正在邀请您加入企业微信\" }, \"quote_area\": { \"type\": 1, \"url\": \"https://work.weixin.qq.com\", \"title\": \"企业微信的引用样式\", \"quote_text\": \"企业微信真好用呀真好用\" }, \"sub_title_text\" : \"下载企业微信还能抢红包!\", \"horizontal_content_list\" : [ { \"keyname\": \"邀请人\", \"value\": \"张三\" }, { \"type\": 1, \"keyname\": \"企业微信官网\", \"value\": \"点击访问\", \"url\": \"https://work.weixin.qq.com\" } ], \"card_action\": { \"type\": 1, \"url\": \"https://developer.work.weixin.qq.com/document/path/90236#%E6%8C%89%E9%92%AE%E4%BA%A4%E4%BA%92%E5%9E%8B\" }, \"task_id\": \"11234\", \"button_selection\": { \"question_key\": \"btn_question_key1\", \"title\": \"企业微信评分\", \"option_list\": [ { \"id\": \"btn_selection_id1\", \"text\": \"100分\" }, { \"id\": \"btn_selection_id2\", \"text\": \"101分\" } ], \"selected_id\": \"btn_selection_id1\" }, \"button_list\": [ { \"text\": \"按钮1\", \"style\": 1, \"key\": \"button_key_1\" }, { \"text\": \"按钮2\", \"style\": 2, \"key\": \"button_key_2\" } ] }"
}
}1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
qiYeWeChatButton 是转义后的json字符串。json内容如下
按钮参数说明
| json字段名字 | 是否必填 | 说明 |
|---|---|---|
| card_type | 是 | 模板卡片类型,按钮交互型卡片填写"button_interaction" |
| source | 否 | 卡片来源样式信息,不需要来源样式可不填写 |
| source.icon_url | 否 | 来源图片的url,来源图片的尺寸建议为72*72 |
| source.desc | 否 | 来源图片的描述,建议不超过20个字,(支持id转译) |
| source.desc_color | 否 | 来源文字的颜色,目前支持:0(默认) 灰色,1 黑色,2 红色,3 绿色 |
| action_menu | 否 | 卡片右上角更多操作按钮 |
| action_menu.desc | 否 | 更多操作界面的描述 |
| action_menu.action_list | 是 | 操作列表,列表长度取值范围为 [1, 3] |
| action_menu.action_list.text | 是 | 操作的描述文案 |
| action_menu.action_list.key | 是 | 操作key值,用户点击后,会产生回调事件将本参数作为EventKey返回,回调事件会带上该key值,最长支持1024字节,不可重复 |
| main_title.title | 是 | 一级标题,建议不超过36个字,(支持id转译) |
| main_title.desc | 否 | 标题辅助信息,建议不超过44个字,(支持id转译) |
| quote_area | 否 | 引用文献样式 |
| quote_area.type | 否 | 引用文献样式区域点击事件,0或不填代表没有点击事件,1 代表跳转url,2 代表跳转小程序 |
| quote_area.url | 否 | 点击跳转的url,quote_area.type是1时必填 |
| quote_area.appid | 否 | 点击跳转的小程序的appid,必须是与当前应用关联的小程序,quote_area.type是2时必填 |
| quote_area.pagepath | 否 | 点击跳转的小程序的pagepath,quote_area.type是2时选填 |
| quote_area.title | 否 | 引用文献样式的标题 |
| quote_area.quote_text | 否 | 引用文献样式的引用文案 |
| sub_title_text | 否 | 二级普通文本,建议不超过160个字,(支持id转译) |
| horizontal_content_list | 否 | 二级标题+文本列表,该字段可为空数组,但有数据的话需确认对应字段是否必填,列表长度不超过6 |
| horizontal_content_list.type | 否 | 链接类型,0或不填代表不是链接,1 代表跳转url,3 代表点击跳转成员详情 |
| horizontal_content_list.keyname | 是 | 二级标题,建议不超过5个字 |
| horizontal_content_list.value | 否 | 二级文本,建议不超过30个字,(支持id转译) |
| horizontal_content_list.url | 否 | 链接跳转的url,horizontal_content_list.type是1时必填 |
| horizontal_content_list.userid | 否 | 成员详情的userid,horizontal_content_list.type是3时必填 |
| card_action | 否 | 整体卡片的点击跳转事件 |
| card_action.type | 否 | 跳转事件类型,0或不填代表不是链接,1 代表跳转url,2 代表打开小程序 |
| card_action.url | 否 | 跳转事件的url,card_action.type是1时必填 |
| card_action.appid | 否 | 跳转事件的小程序的appid,必须是与当前应用关联的小程序,card_action.type是2时必填 |
| card_action.pagepath | 否 | 跳转事件的小程序的pagepath,card_action.type是2时选填 |
| task_id | 是 | 任务id,同一个应用任务id不能重复,只能由数字、字母和“_-@”组成,最长128字节 |
| button_selection.question_key | 是 | 下拉式的选择器的key,用户提交选项后,会产生回调事件,回调事件会带上该key值表示该题,最长支持1024字节 |
| button_selection.title | 否 | 下拉式的选择器左边的标题 |
| button_selection.option_list | 是 | 选项列表,下拉选项不超过 10 个,最少1个 |
| button_selection.selected_id | 否 | 默认选定的id,不填或错填默认第一个 |
| button_selection.option_list.id | 是 | 下拉式的选择器选项的id,用户提交后,会产生回调事件,回调事件会带上该id值表示该选项,最长支持128字节,不可重复 |
| button_selection.option_list.text | 是 | 下拉式的选择器选项的文案,建议不超过16个字 |
| button_list | 是 | 按钮列表,列表长度不超过6 |
| button_list.type | 否 | 按钮点击事件类型,0 或不填代表回调点击事件,1 代表跳转url |
| button_list.text | 是 | 按钮文案,建议不超过10个字 |
| button_list.style | 否 | 按钮样式,目前可填1~4,不填或错填默认1 |
| button_list.key | 否 | 按钮key值,用户点击后,会产生回调事件将本参数作为EventKey返回,回调事件会带上该key值,最长支持1024字节,不可重复,button_list.type是0时必填 |
| button_list.url | 否 | 跳转事件的url,button_list.type是1时必填 |
json示例
{
"card_type" : "button_interaction",
"source" : {
"icon_url": "http://caspportal.wisedu.com/oss/appIcon/mc/attachment/665153739965440.jpg?sign=p6UF9k-_HSo2HXlyhGjp7PVu1BJCBQxseCsDtzGNKGLcymQHWGOgpCIKGa-qKTFa",
"desc": "企业微信",
"desc_color": 1
},
"action_menu": {
"desc": "卡片副交互辅助文本说明",
"action_list": [
{"text": "接受推送", "key": "A"},
{"text": "不再推送", "key": "B"}
]
},
"main_title" : {
"title" : "欢迎使用企业微信",
"desc" : "您的好友正在邀请您加入企业微信"
},
"quote_area": {
"type": 1,
"url": "https://work.weixin.qq.com",
"title": "企业微信的引用样式",
"quote_text": "企业微信真好用呀真好用"
},
"sub_title_text" : "下载企业微信还能抢红包!",
"horizontal_content_list" : [
{
"keyname": "邀请人",
"value": "张三"
},
{
"type": 1,
"keyname": "企业微信官网",
"value": "点击访问",
"url": "https://work.weixin.qq.com"
},
{
"type": 3,
"keyname": "员工信息",
"value": "点击查看",
"userid": "zhangsan"
}
],
"card_action": {
"type": 1,
"url": "https://developer.work.weixin.qq.com/document/path/90236#%E6%8C%89%E9%92%AE%E4%BA%A4%E4%BA%92%E5%9E%8B"
},
"task_id": "1",
"button_selection": {
"question_key": "btn_question_key1",
"title": "企业微信评分",
"option_list": [
{
"id": "btn_selection_id1",
"text": "100分"
},
{
"id": "btn_selection_id2",
"text": "101分"
}
],
"selected_id": "btn_selection_id1"
},
"button_list": [
{
"text": "按钮1",
"style": 1,
"key": "button_key_1"
},
{
"text": "按钮2",
"style": 2,
"key": "button_key_2"
}
]
}1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
响应说明
响应体
数据格式:
JSON
| 字段名 | 参数名 | 是否必填 | 类型 | 描述 |
|---|---|---|---|---|
| 状态 | status | 是 | String | |
| 信息 | msg | 是 | String | |
| msgId | msgId | 是 | String |
响应示例
200 OK
Content-Type: application/json; charset=utf-8
{
"msg": "success",
"msgId": "991905039327232",
"status": 200
}1
2
3
4
5
6
7
8
2
3
4
5
6
7
8
错误码
| 错误码 | 描述 |
|---|---|
| 200 | 成功 |
| 111001 | 必填参数不能为空 |
| 111002 | 请求参数格式错误,例如:参数值不在要求范围内。 |
| 999 | 统一错误码,详细描述信息参见接口返回 |
| 其他 | 失败 |
通用消息(收件箱、今日校园、邮箱、短信、welink)
java
// 创建客户端
Client client = new DefaultClient(BASE_URL, APP_ID, APP_SECRET);
// 创建请求对象
String sendTypes = SendType_Constants.PORTAL_CAMPUS_DAILY + SendType_Constants.PORTAL_ONLY
+ SendType_Constants.CAMPUS_DAILY_ONLY + SendType_Constants.EMAIL
+ SendType_Constants.SMS + SendType_Constants.WELINK;
SendMsgRequest request = new SendMsgRequest();
request.setSubject("测试标题");
request.setContent("测试内容");
request.setMsgType(MsgType_Constants.COMMON);
request.setSendType(sendTypes);
request.setPcUrl("http://www.baidu.com");
request.setMobileUrl("http//wap.baidu.com");
ReceiverDto receiverDto = new ReceiverDto();
receiverDto.setUserId("01119092");
receiverDto.setEmail("01119092@wisedu.com");
receiverDto.setMobile("18362972857");
List<ReceiverDto> receiverDtoList = new ArrayList<ReceiverDto>();
receiverDtoList.add(receiverDto);
request.setReceivers(receiverDtoList);
SendMsgResponse response = client.execute(request);
//调用成功,则处理业务逻辑
if (response.isSuccess()) {
//.....
System.out.println(response.getMsgId());
} else {
throw new Exception("消息发送失败:" + response.getMsg());
}1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
钉钉消息
java
// 创建客户端
Client client = new DefaultClient(BASE_URL, APP_ID, APP_SECRET);
// 创建请求对象
String sendTypes = SendType_Constants.DING_ENTERPRISE;
SendMsgRequest request = new SendMsgRequest();
request.setSubject("钉钉消息");
request.setContent("钉钉消息");
request.setMsgType(MsgType_Constants.COMMON);
request.setSendType(sendTypes);
request.setPcUrl("http://www.baidu.com");
request.setMobileUrl("http//wap.baidu.com");
//钉钉文本
request.setDingSendType(DingSendType_Constants.TEXT);
// //钉钉actioncard
// request.setDingSendType(DingSendType_Constants.ACTION_CARD);
// //钉钉链接
// request.setDingSendType(DingSendType_Constants.LINK);
// request.setDingTalkImgUrl("");
// //钉钉markdown
// request.setDingSendType(DingSendType_Constants.MARKDOWN);
ReceiverDto receiverDto = new ReceiverDto();
receiverDto.setUserId("01119092");
receiverDto.setEmail("01119092@wisedu.com");
receiverDto.setMobile("18362972857");
List<ReceiverDto> receiverDtoList = new ArrayList<ReceiverDto>();
receiverDtoList.add(receiverDto);
request.setReceivers(receiverDtoList);
SendMsgResponse response = client.execute(request);
//调用成功,则处理业务逻辑
if (response.isSuccess()) {
//.....
System.out.println(response.getMsgId());
} else {
throw new Exception("消息发送失败:" + response.getMsg());
}1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
企业微信(文本、卡片、图文)
java
// 创建客户端
Client client = new DefaultClient(BASE_URL, APP_ID, APP_SECRET);
// 创建请求对象
String sendTypes = SendType_Constants.WECHAT_ENTERPRISE;
SendMsgRequest request = new SendMsgRequest();
request.setSubject("企业微信消息");
request.setContent("企业微信消息");
request.setMsgType(MsgType_Constants.COMMON);
request.setSendType(sendTypes);
request.setPcUrl("http://www.baidu.com");
request.setMobileUrl("http//wap.baidu.com");
// //企业微信文本
request.setWxSendType(WxSendType_Constants.TEXT);
// //企业微信图文
// request.setWxSendType(WxSendType_Constants.NEWS);
// request.setQyWeChatImgUrl("");
// //企业微信卡片
// request.setWxSendType(WxSendType_Constants.TEXT_CARD);
ReceiverDto receiverDto = new ReceiverDto();
receiverDto.setUserId("01119092");
receiverDto.setEmail("01119092@wisedu.com");
receiverDto.setMobile("18362972857");
List<ReceiverDto> receiverDtoList = new ArrayList<ReceiverDto>();
receiverDtoList.add(receiverDto);
request.setReceivers(receiverDtoList);
SendMsgResponse response = client.execute(request);
//调用成功,则处理业务逻辑
if (response.isSuccess()) {
//.....
System.out.println(response.getMsgId());
} else {
throw new Exception("消息发送失败:" + response.getMsg());
}1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
企业微信按钮
java
// 创建客户端
Client client = new DefaultClient(BASE_URL, APP_ID, APP_SECRET);
// 创建请求对象
String sendTypes = SendType_Constants.WECHAT_ENTERPRISE;
SendMsgRequest request = new SendMsgRequest();
request.setSubject("企业微信按钮消息1");
request.setContent("企业微信按钮消息1");
request.setMsgType(MsgType_Constants.COMMON);
request.setSendType(sendTypes);
request.setPcUrl("http://www.baidu.com");
request.setMobileUrl("http//wap.baidu.com");
request.setWxSendType(WxSendType_Constants.BUTTON);
ButtonInteractionCard buttonInteractionCard = new ButtonInteractionCard();
buttonInteractionCard.setCard_type("button_interaction");
ButtonInteractionCard.MainTitle mainTitle = new ButtonInteractionCard.MainTitle();
mainTitle.setTitle("按钮消息1");
buttonInteractionCard.setMain_title(mainTitle);
//每次请求不可以一样
String taskId = "taskId_125";
buttonInteractionCard.setTask_id(taskId);
ArrayList<ButtonInteractionCard.Button> buttons = new ArrayList<>();
ButtonInteractionCard.Button button = new ButtonInteractionCard.Button();
button.setKey("button_key_1");
button.setText("按钮1");
button.setStyle(1);
ButtonInteractionCard.Button button2 = new ButtonInteractionCard.Button();
button2.setKey("button_key_2");
button2.setText("按钮2");
button2.setStyle(2);
buttons.add(button);
buttons.add(button2);
buttonInteractionCard.setButton_list(buttons);
Map<String, String> map = new HashMap<String, String>();
//固定值 "qiYeWeChatButton"
map.put("qiYeWeChatButton", JSON.toJSONString(buttonInteractionCard));
request.setExtParams(map);
ReceiverDto receiverDto = new ReceiverDto();
receiverDto.setUserId("01119092");
receiverDto.setEmail("01119092@wisedu.com");
receiverDto.setMobile("18362972857");
List<ReceiverDto> receiverDtoList = new ArrayList<ReceiverDto>();
receiverDtoList.add(receiverDto);
request.setReceivers(receiverDtoList);
SendMsgResponse response = client.execute(request);
//调用成功,则处理业务逻辑
if (response.isSuccess()) {
//.....
System.out.println(response.getMsgId());
} else {
throw new Exception("消息发送失败:" + response.getMsg());
}1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54

