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());
ITopClient client = new DefaultTopClient(url, appkey, secret);
AlibabaIcbuAmesMsgcenterMsgSendRequest req = new AlibabaIcbuAmesMsgcenterMsgSendRequest();
AlibabaIcbuAmesMsgcenterMsgSendRequest.MsgCreateRequestDTODomain obj1 = new AlibabaIcbuAmesMsgcenterMsgSendRequest.MsgCreateRequestDTODomain();
List<AlibabaIcbuAmesMsgcenterMsgSendRequest.MailAttachmentDomain> list3 = new List<AlibabaIcbuAmesMsgcenterMsgSendRequest.MailAttachmentDomain>();
AlibabaIcbuAmesMsgcenterMsgSendRequest.MailAttachmentDomain obj4 = new AlibabaIcbuAmesMsgcenterMsgSendRequest.MailAttachmentDomain();
list3.Add(obj4);
obj4.Path = "文件url";
obj4.FileName = "文件名称";
obj1.Attachments= list3;
obj1.MsgTemplateCode = "ames_enterprise_invitation";
obj1.Context = "{\"key\":\"value\"}";
obj1.BizId = "123";
AlibabaIcbuAmesMsgcenterMsgSendRequest.TargetGroupDTODomain obj5 = new AlibabaIcbuAmesMsgcenterMsgSendRequest.TargetGroupDTODomain();
obj5.PersonnelAccountId = "";
obj5.PersonnelMerchantId = "1";
obj5.PersonnelRoleCodes = "";
obj1.TargetGroupDTO= obj5;
obj1.TenantCode = "onetouch";
obj1.MsgCreatorId = "123";
obj1.MsgCreatorName = "姓名";
List<AlibabaIcbuAmesMsgcenterMsgSendRequest.TargetChannelInfoDTODomain> list7 = new List<AlibabaIcbuAmesMsgcenterMsgSendRequest.TargetChannelInfoDTODomain>();
AlibabaIcbuAmesMsgcenterMsgSendRequest.TargetChannelInfoDTODomain obj8 = new AlibabaIcbuAmesMsgcenterMsgSendRequest.TargetChannelInfoDTODomain();
list7.Add(obj8);
obj8.DingTalk = "123";
obj8.Mobile = "1382350xxxx";
obj8.Email = "test@163.com";
obj1.ChannelInfoDTOs= list7;
req.MsgCreateRequestDto_ = obj1;
AlibabaIcbuAmesMsgcenterMsgSendResponse rsp = client.Execute(req);
Console.WriteLine(rsp.Body);
$c = new TopClient;
$c->appkey = $appkey;
$c->secretKey = $secret;
$req = new AlibabaIcbuAmesMsgcenterMsgSendRequest;
$msg_create_request_dto = new MsgCreateRequestDTO;
$attachments = new MailAttachment;
$attachments->path="文件url";
$attachments->file_name="文件名称";
$msg_create_request_dto->attachments = $attachments;
$msg_create_request_dto->msg_template_code="ames_enterprise_invitation";
$msg_create_request_dto->context="{\"key\":\"value\"}";
$msg_create_request_dto->biz_id="123";
$target_group_d_t_o = new TargetGroupDTO;
$target_group_d_t_o->personnel_account_id="";
$target_group_d_t_o->personnel_merchant_id="1";
$target_group_d_t_o->personnel_role_codes="";
$msg_create_request_dto->target_group_d_t_o = $target_group_d_t_o;
$msg_create_request_dto->tenant_code="onetouch";
$msg_create_request_dto->msg_creator_id="123";
$msg_create_request_dto->msg_creator_name="姓名";
$channel_info_d_t_os = new TargetChannelInfoDTO;
$channel_info_d_t_os->ding_talk="123";
$channel_info_d_t_os->mobile="1382350xxxx";
$channel_info_d_t_os->email="test@163.com";
$msg_create_request_dto->channel_info_d_t_os = $channel_info_d_t_os;
$req->setMsgCreateRequestDto(json_encode($msg_create_request_dto));
$resp = $c->execute($req);
curl -X POST 'http://gw.api.taobao.com/router/rest' \
-H 'Content-Type:application/x-www-form-urlencoded;charset=utf-8' \
-d 'app_key=12129701' \
-d 'format=json' \
-d 'method=alibaba.icbu.ames.msgcenter.msg.send' \
-d 'partner_id=apidoc' \
-d 'sign=DC87C25CCB29FC9DC1FFCAA3C6C175DA' \
-d 'sign_method=hmac' \
-d 'timestamp=2025-05-11+23%3A20%3A38' \
-d 'v=2.0' \
-d 'msg_create_request_dto=null'
# -*- coding: utf-8 -*-
import top.api
req=top.api.AlibabaIcbuAmesMsgcenterMsgSendRequest(url,port)
req.set_app_info(top.appinfo(appkey,secret))
req.msg_create_request_dto="数据结构示例JSON格式"
try:
resp= req.getResponse()
print(resp)
except Exception,e:
print(e)
pTopRequest pRequest = alloc_top_request();
pTopResponse pResponse = NULL;
pTaobaoClient pClient = alloc_taobao_client(url, appkey, appsecret);
set_api_name(pRequest,"alibaba.icbu.ames.msgcenter.msg.send");
add_param(pRequest,"msg_create_request_dto","数据结构JSON示例");
pResponse = top_execute(pClient,pRequest,NULL);
printf("ret code:%d\n",pResponse->code);
if(pResponse->code == 0){
pTopResponseIterator ite = init_response_iterator(pResponse);
pResultItem pResultItem = alloc_result_item();
while(parseNext(ite, pResultItem) == 0){
printf("%s:%s\n",pResultItem->key,pResultItem->value);
}
destroy_response_iterator(ite);
destroy_result_item(pResultItem);
}
destroy_top_request(pRequest);
destroy_top_response(pResponse);
destroy_taobao_client(pClient);
TopClient = require('./topClient').TopClient;
var client = new TopClient({
'appkey': 'appkey',
'appsecret': 'secret',
'REST_URL': 'http://gw.api.taobao.com/router/rest'
});
client.execute('alibaba.icbu.ames.msgcenter.msg.send', {
'msg_create_request_dto':'数据结构JSON示例'
}, function(error, response) {
if (!error) console.log(response);
else console.log(error);
})