文档中心 > API类目 > ICBU-一达通

alibaba.icbu.ames.msgcenter.msg.send (ames消息中心消息发送api)

ames消息中心消息发送api

公共参数

请求参数

名称 类型 是否必须 示例值 更多限制 描述
msg_create_request_dto MsgCreateRequestDTO 必须 参数
  • attachments
  • MailAttachment []
  • 可选
  • 邮件附件,在使用邮件时使用
  • └ path
  • String
  • 可选
  • 文件url
  • 附件路径,在EVE存储数据的路径
  • └ file_name
  • String
  • 可选
  • 文件名称
  • 附件名称
  • └ msg_template_code
  • String
  • 必须
  • ames_enterprise_invitation
  • 消息中心后台配置的模板code,需要联系消息中心开发配置
  • └ context
  • String
  • 可选
  • {"key":"value"}
  • 消息变量的值,用于替换消息模板配置的变量
  • └ biz_id
  • String
  • 必须
  • 123
  • 业务id,场景侧定义,用于消息幂等控制和业务id传递
  • target_group_d_t_o
  • TargetGroupDTO
  • 必须
  • 消息目标群体DTO
  • └ personnel_account_id
  • String []
  • 可选
  • 人员账号id。AMES商家员工 此场景下传值 user_eid。AMES用户账号 此场景下传值 user_pid。
  • └ personnel_merchant_id
  • String
  • 可选
  • 1
  • 人员商户id,如:服务商id,客户id,小二默认传0 (必填)。AMES商家员工 此场景下传值 eid。AMES用户账号 此场景下传值 0
  • └ personnel_role_codes
  • String []
  • 可选
  • 目标人群人员角色codes (角色和人员账号二者必填其一)
  • └ tenant_code
  • String
  • 必须
  • onetouch
  • 租户code,默认填写onetouch
  • └ msg_creator_id
  • String
  • 可选
  • 123
  • 创建人id
  • └ msg_creator_name
  • String
  • 可选
  • 姓名
  • 创建人名称
  • channel_info_d_t_os
  • TargetChannelInfoDTO []
  • 可选
  • 自定义渠道参数,用于单独发送短信和邮件时使用
  • └ ding_talk
  • String
  • 可选
  • 123
  • 钉钉
  • └ mobile
  • String
  • 可选
  • 1382350xxxx
  • 手机号
  • └ email
  • String
  • 可选
  • test@163.com
  • 邮箱地址

响应参数

名称 类型 示例值 描述
data Number 123 消息id

请求示例

  • JAVA
  • .NET
  • PHP
  • CURL
  • Python
  • C/C++
  • NodeJS
TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
AlibabaIcbuAmesMsgcenterMsgSendRequest req = new AlibabaIcbuAmesMsgcenterMsgSendRequest();
AlibabaIcbuAmesMsgcenterMsgSendRequest.MsgCreateRequestDTO obj1 = new AlibabaIcbuAmesMsgcenterMsgSendRequest.MsgCreateRequestDTO();
List<AlibabaIcbuAmesMsgcenterMsgSendRequest.MailAttachment> list3 = new ArrayList<AlibabaIcbuAmesMsgcenterMsgSendRequest.MailAttachment>();
AlibabaIcbuAmesMsgcenterMsgSendRequest.MailAttachment obj4 = new AlibabaIcbuAmesMsgcenterMsgSendRequest.MailAttachment();
list3.add(obj4);
obj4.setPath("文件url");
obj4.setFileName("文件名称");
obj1.setAttachments(list3);
obj1.setMsgTemplateCode("ames_enterprise_invitation");
obj1.setContext("{\"key\":\"value\"}");
obj1.setBizId("123");
AlibabaIcbuAmesMsgcenterMsgSendRequest.TargetGroupDTO obj5 = new AlibabaIcbuAmesMsgcenterMsgSendRequest.TargetGroupDTO();
obj5.setPersonnelAccountId("");
obj5.setPersonnelMerchantId("1");
obj5.setPersonnelRoleCodes("");
obj1.setTargetGroupDTO(obj5);
obj1.setTenantCode("onetouch");
obj1.setMsgCreatorId("123");
obj1.setMsgCreatorName("姓名");
List<AlibabaIcbuAmesMsgcenterMsgSendRequest.TargetChannelInfoDTO> list7 = new ArrayList<AlibabaIcbuAmesMsgcenterMsgSendRequest.TargetChannelInfoDTO>();
AlibabaIcbuAmesMsgcenterMsgSendRequest.TargetChannelInfoDTO obj8 = new AlibabaIcbuAmesMsgcenterMsgSendRequest.TargetChannelInfoDTO();
list7.add(obj8);
obj8.setDingTalk("123");
obj8.setMobile("1382350xxxx");
obj8.setEmail("test@163.com");
obj1.setChannelInfoDTOs(list7);
req.setMsgCreateRequestDto(obj1);
AlibabaIcbuAmesMsgcenterMsgSendResponse rsp = client.execute(req);
System.out.println(rsp.getBody());

响应示例

  • XML示例
  • JSON示例
<alibaba_icbu_ames_msgcenter_msg_send_response>
    <data>123</data>
</alibaba_icbu_ames_msgcenter_msg_send_response>

异常示例

  • XML示例
  • JSON示例
<error_response>
    <code>50</code>
    <msg>Remote service error</msg>
    <sub_code>isv.invalid-parameter</sub_code>
    <sub_msg>非法参数</sub_msg>
</error_response>

错误码解释

错误码 错误描述 解决方案
403 消息幂等错误,同一个消息一天只能发送一次 不允许给同一个消息接收人,重复发送同样的消息
450 参数缺失 请补充参数

API工具

如何获得此API

FAQ

返回
顶部