TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
TbkMarketingMsgSendRequest req = new TbkMarketingMsgSendRequest();
req.setFuncType(1L);
req.setMsgId("h7a9dht4l");
req.setMaterialType(1L);
req.setTemplateId(7989L);
req.setMaterialId("mda76h9fa7-7dbaliu4q");
req.setUvid("jo3iha09fn7ed");
req.setAdzoneId("123");
req.setSmallPicUrl("pic.aliyun.com");
req.setIconId("123");
req.setBackPicId("123");
req.setNotifyId("20231111");
req.setTitleColor(1L);
req.setAdvancedStyle(1L);
req.setUnfold(0L);
req.setStartTime("2023-11-11 00:00:00");
req.setTestOaid("OAID");
TbkMarketingMsgSendRequest.TargetItemDTO obj1 = new TbkMarketingMsgSendRequest.TargetItemDTO();
obj1.setItemIdList(""top:mda76h9fa7-7dbaliu4q"");
req.setTargetItem(obj1);
TbkMarketingMsgSendResponse rsp = client.execute(req);
System.out.println(rsp.getBody());
ITopClient client = new DefaultTopClient(url, appkey, secret);
TbkMarketingMsgSendRequest req = new TbkMarketingMsgSendRequest();
req.FuncType = 1L;
req.MsgId = "h7a9dht4l";
req.MaterialType = 1L;
req.TemplateId = 7989L;
req.MaterialId = "mda76h9fa7-7dbaliu4q";
req.Uvid = "jo3iha09fn7ed";
req.AdzoneId = "123";
req.SmallPicUrl = "pic.aliyun.com";
req.IconId = "123";
req.BackPicId = "123";
req.NotifyId = "20231111";
req.TitleColor = 1L;
req.AdvancedStyle = 1L;
req.Unfold = 0L;
req.StartTime = "2023-11-11 00:00:00";
req.TestOaid = "OAID";
TbkMarketingMsgSendRequest.TargetItemDTODomain obj1 = new TbkMarketingMsgSendRequest.TargetItemDTODomain();
obj1.ItemIdList = ""top:mda76h9fa7-7dbaliu4q"";
req.TargetItem_ = obj1;
TbkMarketingMsgSendResponse rsp = client.Execute(req);
Console.WriteLine(rsp.Body);
$c = new TopClient;
$c->appkey = $appkey;
$c->secretKey = $secret;
$req = new TbkMarketingMsgSendRequest;
$req->setFuncType("1");
$req->setMsgId("h7a9dht4l");
$req->setMaterialType("1");
$req->setTemplateId("7989");
$req->setMaterialId("mda76h9fa7-7dbaliu4q");
$req->setUvid("jo3iha09fn7ed");
$req->setAdzoneId("123");
$req->setSmallPicUrl("pic.aliyun.com");
$req->setIconId("123");
$req->setBackPicId("123");
$req->setNotifyId("20231111");
$req->setTitleColor("1");
$req->setAdvancedStyle("1");
$req->setUnfold("0");
$req->setStartTime("2023-11-11 00:00:00");
$req->setTestOaid("OAID");
$target_item = new TargetItemDTO;
$target_item->item_id_list="[\"top:mda76h9fa7-7dbaliu4q\"]";
$req->setTargetItem(json_encode($target_item));
$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=taobao.tbk.marketing.msg.send' \
-d 'partner_id=apidoc' \
-d 'sign=5916572BEAD3AF53C378282E35375037' \
-d 'sign_method=hmac' \
-d 'timestamp=2024-05-08+10%3A54%3A21' \
-d 'v=2.0' \
-d 'advanced_style=1' \
-d 'adzone_id=123' \
-d 'back_pic_id=123' \
-d 'func_type=1' \
-d 'icon_id=123' \
-d 'material_id=mda76h9fa7-7dbaliu4q' \
-d 'material_type=1' \
-d 'msg_id=h7a9dht4l' \
-d 'notify_id=20231111' \
-d 'small_pic_url=pic.aliyun.com' \
-d 'start_time=2023-11-11+00%3A00%3A00' \
-d 'target_item=null' \
-d 'template_id=7989' \
-d 'test_oaid=OAID' \
-d 'title_color=1' \
-d 'unfold=0' \
-d 'uvid=jo3iha09fn7ed'
# -*- coding: utf-8 -*-
import top.api
req=top.api.TbkMarketingMsgSendRequest(url,port)
req.set_app_info(top.appinfo(appkey,secret))
req.func_type=1
req.msg_id="h7a9dht4l"
req.material_type=1
req.template_id=7989
req.material_id="mda76h9fa7-7dbaliu4q"
req.uvid="jo3iha09fn7ed"
req.adzone_id="123"
req.small_pic_url="pic.aliyun.com"
req.icon_id="123"
req.back_pic_id="123"
req.notify_id="20231111"
req.title_color=1
req.advanced_style=1
req.unfold=0
req.start_time="2023-11-11 00:00:00"
req.test_oaid="OAID"
req.target_item="数据结构示例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,"taobao.tbk.marketing.msg.send");
add_param(pRequest,"func_type","1");
add_param(pRequest,"msg_id","h7a9dht4l");
add_param(pRequest,"material_type","1");
add_param(pRequest,"template_id","7989");
add_param(pRequest,"material_id","mda76h9fa7-7dbaliu4q");
add_param(pRequest,"uvid","jo3iha09fn7ed");
add_param(pRequest,"adzone_id","123");
add_param(pRequest,"small_pic_url","pic.aliyun.com");
add_param(pRequest,"icon_id","123");
add_param(pRequest,"back_pic_id","123");
add_param(pRequest,"notify_id","20231111");
add_param(pRequest,"title_color","1");
add_param(pRequest,"advanced_style","1");
add_param(pRequest,"unfold","0");
add_param(pRequest,"start_time","2023-11-11 00:00:00");
add_param(pRequest,"test_oaid","OAID");
add_param(pRequest,"target_item","数据结构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('taobao.tbk.marketing.msg.send', {
'func_type':'1',
'msg_id':'h7a9dht4l',
'material_type':'1',
'template_id':'7989',
'material_id':'mda76h9fa7-7dbaliu4q',
'uvid':'jo3iha09fn7ed',
'adzone_id':'123',
'small_pic_url':'pic.aliyun.com',
'icon_id':'123',
'back_pic_id':'123',
'notify_id':'20231111',
'title_color':'1',
'advanced_style':'1',
'unfold':'0',
'start_time':'2023-11-11 00:00:00',
'test_oaid':'OAID',
'target_item':'数据结构JSON示例'
}, function(error, response) {
if (!error) console.log(response);
else console.log(error);
})