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.setStartTime("2023-11-11 00:00:00");
req.setTestOaid("OAID");
TbkMarketingMsgSendRequest.TargetItemDTO obj1 = new TbkMarketingMsgSendRequest.TargetItemDTO();
obj1.setItemIdList(""top:mda76h9fa7-7dbaliu4q"");
req.setTargetItem(obj1);
req.setManufacturer("huawei");
TbkMarketingMsgSendRequest.HwMap obj2 = new TbkMarketingMsgSendRequest.HwMap();
obj2.setBackPicId("123");
obj2.setTitleColor(1L);
obj2.setAdvancedStyle(1L);
obj2.setIconId("123");
obj2.setSmallPicUrl("pic.aliyun.com");
obj2.setNotifyId("20231111");
obj2.setUnfold(1L);
obj2.setLightBackPicId("123");
req.setHuaweiSp(obj2);
TbkMarketingMsgSendRequest.OpMap obj3 = new TbkMarketingMsgSendRequest.OpMap();
obj3.setShowTime(2L);
obj3.setNotifyStyle(1L);
obj3.setMidPicUrl("gw.alicdn.com");
obj3.setBigPicUrl("gw.alicdn.com");
obj3.setMaterialId("123");
obj3.setFoldGroup("group1");
obj3.setMsgLabel(1L);
obj3.setUnfold(1L);
obj3.setIsTop(1L);
req.setOppoSp(obj3);
TbkMarketingMsgSendRequest.RyMap obj4 = new TbkMarketingMsgSendRequest.RyMap();
obj4.setTitleColor(1L);
obj4.setAdvancedStyle(1L);
obj4.setBackPicUrl("gw.alicdn.com");
obj4.setTopStartTime("2024-07-01 03:59");
obj4.setTopEndTime("2024-07-02 03:59");
obj4.setBigPicUrl("gw.alicdn.com");
obj4.setBigPicExpireTime("2024-07-01 23:59");
obj4.setBigPicExpireAction(1L);
obj4.setLockRing(1L);
req.setRongyaoSp(obj4);
req.setForInnerTest(false);
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.StartTime = "2023-11-11 00:00:00";
req.TestOaid = "OAID";
TbkMarketingMsgSendRequest.TargetItemDTODomain obj1 = new TbkMarketingMsgSendRequest.TargetItemDTODomain();
obj1.ItemIdList = ""top:mda76h9fa7-7dbaliu4q"";
req.TargetItem_ = obj1;
req.Manufacturer = "huawei";
TbkMarketingMsgSendRequest.HwMapDomain obj2 = new TbkMarketingMsgSendRequest.HwMapDomain();
obj2.BackPicId = "123";
obj2.TitleColor = 1L;
obj2.AdvancedStyle = 1L;
obj2.IconId = "123";
obj2.SmallPicUrl = "pic.aliyun.com";
obj2.NotifyId = "20231111";
obj2.Unfold = 1L;
obj2.LightBackPicId = "123";
req.HuaweiSp_ = obj2;
TbkMarketingMsgSendRequest.OpMapDomain obj3 = new TbkMarketingMsgSendRequest.OpMapDomain();
obj3.ShowTime = 2L;
obj3.NotifyStyle = 1L;
obj3.MidPicUrl = "gw.alicdn.com";
obj3.BigPicUrl = "gw.alicdn.com";
obj3.MaterialId = "123";
obj3.FoldGroup = "group1";
obj3.MsgLabel = 1L;
obj3.Unfold = 1L;
obj3.IsTop = 1L;
req.OppoSp_ = obj3;
TbkMarketingMsgSendRequest.RyMapDomain obj4 = new TbkMarketingMsgSendRequest.RyMapDomain();
obj4.TitleColor = 1L;
obj4.AdvancedStyle = 1L;
obj4.BackPicUrl = "gw.alicdn.com";
obj4.TopStartTime = "2024-07-01 03:59";
obj4.TopEndTime = "2024-07-02 03:59";
obj4.BigPicUrl = "gw.alicdn.com";
obj4.BigPicExpireTime = "2024-07-01 23:59";
obj4.BigPicExpireAction = 1L;
obj4.LockRing = 1L;
req.RongyaoSp_ = obj4;
req.ForInnerTest = false;
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->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));
$req->setManufacturer("huawei");
$huawei_sp = new HwMap;
$huawei_sp->back_pic_id="123";
$huawei_sp->title_color="1";
$huawei_sp->advanced_style="1";
$huawei_sp->icon_id="123";
$huawei_sp->small_pic_url="pic.aliyun.com";
$huawei_sp->notify_id="20231111";
$huawei_sp->unfold="1";
$huawei_sp->light_back_pic_id="123";
$req->setHuaweiSp(json_encode($huawei_sp));
$oppo_sp = new OpMap;
$oppo_sp->show_time="2";
$oppo_sp->notify_style="1";
$oppo_sp->mid_pic_url="gw.alicdn.com";
$oppo_sp->big_pic_url="gw.alicdn.com";
$oppo_sp->material_id="123";
$oppo_sp->fold_group="group1";
$oppo_sp->msg_label="1";
$oppo_sp->unfold="1";
$oppo_sp->is_top="1";
$req->setOppoSp(json_encode($oppo_sp));
$rongyao_sp = new RyMap;
$rongyao_sp->title_color="1";
$rongyao_sp->advanced_style="1";
$rongyao_sp->back_pic_url="gw.alicdn.com";
$rongyao_sp->top_start_time="2024-07-01 03:59";
$rongyao_sp->top_end_time="2024-07-02 03:59";
$rongyao_sp->big_pic_url="gw.alicdn.com";
$rongyao_sp->big_pic_expire_time="2024-07-01 23:59";
$rongyao_sp->big_pic_expire_action="1";
$rongyao_sp->lock_ring="1";
$req->setRongyaoSp(json_encode($rongyao_sp));
$req->setForInnerTest("false");
$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=100314C2D8FDB5E55E47B30CF9808D53' \
-d 'sign_method=hmac' \
-d 'timestamp=2025-01-16+00%3A51%3A05' \
-d 'v=2.0' \
-d 'adzone_id=123' \
-d 'for_inner_test=false' \
-d 'func_type=1' \
-d 'huawei_sp=HuaWeiSpMap' \
-d 'manufacturer=huawei' \
-d 'material_id=mda76h9fa7-7dbaliu4q' \
-d 'material_type=1' \
-d 'msg_id=h7a9dht4l' \
-d 'oppo_sp=OppoSpMap' \
-d 'rongyao_sp=RongyaoSpMap' \
-d 'start_time=2023-11-11+00%3A00%3A00' \
-d 'target_item=null' \
-d 'template_id=7989' \
-d 'test_oaid=OAID' \
-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.start_time="2023-11-11 00:00:00"
req.test_oaid="OAID"
req.target_item="数据结构示例JSON格式"
req.manufacturer="huawei"
req.huawei_sp="HuaWeiSpMap"
req.oppo_sp="OppoSpMap"
req.rongyao_sp="RongyaoSpMap"
req.for_inner_test=false
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,"start_time","2023-11-11 00:00:00");
add_param(pRequest,"test_oaid","OAID");
add_param(pRequest,"target_item","数据结构JSON示例");
add_param(pRequest,"manufacturer","huawei");
add_param(pRequest,"huawei_sp","数据结构JSON示例");
add_param(pRequest,"oppo_sp","数据结构JSON示例");
add_param(pRequest,"rongyao_sp","数据结构JSON示例");
add_param(pRequest,"for_inner_test","false");
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',
'start_time':'2023-11-11 00:00:00',
'test_oaid':'OAID',
'target_item':'数据结构JSON示例',
'manufacturer':'huawei',
'huawei_sp':'数据结构JSON示例',
'oppo_sp':'数据结构JSON示例',
'rongyao_sp':'数据结构JSON示例',
'for_inner_test':'false'
}, function(error, response) {
if (!error) console.log(response);
else console.log(error);
})