TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
UniversalbpNewCreativeBindRequest req = new UniversalbpNewCreativeBindRequest();
UniversalbpNewCreativeBindRequest.TopServiceContext obj1 = new UniversalbpNewCreativeBindRequest.TopServiceContext();
obj1.setBizCode("xxxxx");
obj1.setLoginType(1L);
obj1.setMemberId(12345L);
obj1.setExt("{}");
req.setTopServiceContext(obj1);
UniversalbpNewCreativeBindRequest.CreativeRefCommandListVO obj2 = new UniversalbpNewCreativeBindRequest.CreativeRefCommandListVO();
List<UniversalbpNewCreativeBindRequest.CreativeRefCommandVO> list4 = new ArrayList<UniversalbpNewCreativeBindRequest.CreativeRefCommandVO>();
UniversalbpNewCreativeBindRequest.CreativeRefCommandVO obj5 = new UniversalbpNewCreativeBindRequest.CreativeRefCommandVO();
list4.add(obj5);
obj5.setCampaignId(68796878069L);
obj5.setAdgroupId(68793666608L);
obj5.setCreativeId(6845715605L);
obj5.setCreativeIdList(new Long[] { 739684500310001 };
);
obj5.setAddMainPicVideo(true);
obj5.setAddAutoCreative(true);
List<UniversalbpNewCreativeBindRequest.MaterialImageInfoVO> list8 = new ArrayList<UniversalbpNewCreativeBindRequest.MaterialImageInfoVO>();
UniversalbpNewCreativeBindRequest.MaterialImageInfoVO obj9 = new UniversalbpNewCreativeBindRequest.MaterialImageInfoVO();
list8.add(obj9);
obj9.setMaterialId(714616513841L);
obj9.setImagePosition(0L);
obj9.setImgUrl("https://img.alicdn.com/bao/uploaded/i1/3838159498/O1CN013BTEpu2K28f5CkcgG_!!3838159498.jpg");
obj9.setLinkUrl("http://item.taobao.com/item.htm?id=668800719012");
obj9.setMaterialName("外投宝贝测试,请不要拍");
list6.setMaterialImageInfoList(list8);
obj2.setCreativeRefList(list4);
req.setCreativeRefCommandListVO(obj2);
UniversalbpNewCreativeBindResponse rsp = client.execute(req, sessionKey);
System.out.println(rsp.getBody());
ITopClient client = new DefaultTopClient(url, appkey, secret);
UniversalbpNewCreativeBindRequest req = new UniversalbpNewCreativeBindRequest();
UniversalbpNewCreativeBindRequest.TopServiceContextDomain obj1 = new UniversalbpNewCreativeBindRequest.TopServiceContextDomain();
obj1.BizCode = "xxxxx";
obj1.LoginType = 1L;
obj1.MemberId = 12345L;
obj1.Ext = "{}";
req.TopServiceContext_ = obj1;
UniversalbpNewCreativeBindRequest.CreativeRefCommandListVODomain obj2 = new UniversalbpNewCreativeBindRequest.CreativeRefCommandListVODomain();
List<UniversalbpNewCreativeBindRequest.CreativeRefCommandVODomain> list4 = new List<UniversalbpNewCreativeBindRequest.CreativeRefCommandVODomain>();
UniversalbpNewCreativeBindRequest.CreativeRefCommandVODomain obj5 = new UniversalbpNewCreativeBindRequest.CreativeRefCommandVODomain();
list4.Add(obj5);
obj5.CampaignId = 68796878069L;
obj5.AdgroupId = 68793666608L;
obj5.CreativeId = 6845715605L;
obj5.CreativeIdList = new long[] { 739684500310001 };
;
obj5.AddMainPicVideo = true;
obj5.AddAutoCreative = true;
List<UniversalbpNewCreativeBindRequest.MaterialImageInfoVODomain> list7 = new List<UniversalbpNewCreativeBindRequest.MaterialImageInfoVODomain>();
UniversalbpNewCreativeBindRequest.MaterialImageInfoVODomain obj8 = new UniversalbpNewCreativeBindRequest.MaterialImageInfoVODomain();
list7.Add(obj8);
obj8.MaterialId = 714616513841L;
obj8.ImagePosition = 0L;
obj8.ImgUrl = "https://img.alicdn.com/bao/uploaded/i1/3838159498/O1CN013BTEpu2K28f5CkcgG_!!3838159498.jpg";
obj8.LinkUrl = "http://item.taobao.com/item.htm?id=668800719012";
obj8.MaterialName = "外投宝贝测试,请不要拍";
obj5.MaterialImageInfoList= list7;
obj2.CreativeRefList= list4;
req.CreativeRefCommandListVO_ = obj2;
UniversalbpNewCreativeBindResponse rsp = client.Execute(req, sessionKey);
Console.WriteLine(rsp.Body);
$c = new TopClient;
$c->appkey = $appkey;
$c->secretKey = $secret;
$req = new UniversalbpNewCreativeBindRequest;
$top_service_context = new TopServiceContext;
$top_service_context->biz_code="xxxxx";
$top_service_context->login_type="1";
$top_service_context->member_id="12345";
$top_service_context->ext="{}";
$req->setTopServiceContext(json_encode($top_service_context));
$creative_ref_command_list_v_o = new CreativeRefCommandListVO;
$creative_ref_list = new CreativeRefCommandVO;
$creative_ref_list->campaign_id="68796878069";
$creative_ref_list->adgroup_id="68793666608";
$creative_ref_list->creative_id="6845715605";
$creative_ref_list->creative_id_list="[739684500310001]";
$creative_ref_list->add_main_pic_video="true";
$creative_ref_list->add_auto_creative="true";
$material_image_info_list = new MaterialImageInfoVO;
$material_image_info_list->material_id="714616513841";
$material_image_info_list->image_position="0";
$material_image_info_list->img_url="https://img.alicdn.com/bao/uploaded/i1/3838159498/O1CN013BTEpu2K28f5CkcgG_!!3838159498.jpg";
$material_image_info_list->link_url="http://item.taobao.com/item.htm?id=668800719012";
$material_image_info_list->material_name="外投宝贝测试,请不要拍";
$creative_ref_list->material_image_info_list = $material_image_info_list;
$creative_ref_command_list_v_o->creative_ref_list = $creative_ref_list;
$req->setCreativeRefCommandListVO(json_encode($creative_ref_command_list_v_o));
$resp = $c->execute($req, $sessionKey);
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.universalbp.new.creative.bind' \
-d 'partner_id=apidoc' \
-d 'session=01a4e89a-1c47-487b-9a13-83d9b89e0244' \
-d 'sign=F7BFC502D2D35E5447C383DDBD82C6AB' \
-d 'sign_method=hmac' \
-d 'timestamp=2025-04-28+15%3A28%3A09' \
-d 'v=2.0' \
-d 'creative_ref_command_list_v_o=null' \
-d 'top_service_context=TopServiceContext'
# -*- coding: utf-8 -*-
import top.api
req=top.api.UniversalbpNewCreativeBindRequest(url,port)
req.set_app_info(top.appinfo(appkey,secret))
req.top_service_context="TopServiceContext"
req.creative_ref_command_list_v_o=""
try:
resp= req.getResponse(sessionkey)
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.universalbp.new.creative.bind");
add_param(pRequest,"top_service_context","数据结构JSON示例");
add_param(pRequest,"creative_ref_command_list_v_o","数据结构JSON示例");
pResponse = top_execute(pClient,pRequest,sessionKey);
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.universalbp.new.creative.bind', {
'top_service_context':'数据结构JSON示例',
'creative_ref_command_list_v_o':'数据结构JSON示例'
}, function(error, response) {
if (!error) console.log(response);
else console.log(error);
})