TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
TbkFeedOptUploadRequest req = new TbkFeedOptUploadRequest();
req.setDeviceType(12L);
req.setEventId(111L);
req.setCampaignId("111");
req.setContentId("content_id");
req.setDeviceId("0df232dd4d757938");
req.setCreativeId("111");
req.setAccountId("111");
req.setIndicatorType(1L);
req.setUnitId("111");
req.setIndicatorValue(1L);
req.setBehaviorTimeStamp(StringUtils.parseDateTime("2023-02-10 23:59:59"));
req.setRequestId("0df232dd4d757938");
req.setExpId("123");
req.setRtaSwitch(1L);
req.setAdConsume(123L);
req.setRtaExtraInfo("xxxxx");
TbkFeedOptUploadResponse rsp = client.execute(req);
System.out.println(rsp.getBody());
ITopClient client = new DefaultTopClient(url, appkey, secret);
TbkFeedOptUploadRequest req = new TbkFeedOptUploadRequest();
req.DeviceType = 12L;
req.EventId = 111L;
req.CampaignId = "111";
req.ContentId = "content_id";
req.DeviceId = "0df232dd4d757938";
req.CreativeId = "111";
req.AccountId = "111";
req.IndicatorType = 1L;
req.UnitId = "111";
req.IndicatorValue = 1L;
req.BehaviorTimeStamp = DateTime.Parse("2023-02-10 23:59:59");
req.RequestId = "0df232dd4d757938";
req.ExpId = "123";
req.RtaSwitch = 1L;
req.AdConsume = 123L;
req.RtaExtraInfo = "xxxxx";
TbkFeedOptUploadResponse rsp = client.Execute(req);
Console.WriteLine(rsp.Body);
$c = new TopClient;
$c->appkey = $appkey;
$c->secretKey = $secret;
$req = new TbkFeedOptUploadRequest;
$req->setDeviceType("12");
$req->setEventId("111");
$req->setCampaignId("111");
$req->setContentId("content_id");
$req->setDeviceId("0df232dd4d757938");
$req->setCreativeId("111");
$req->setAccountId("111");
$req->setIndicatorType("1");
$req->setUnitId("111");
$req->setIndicatorValue("1");
$req->setBehaviorTimeStamp("2023-02-10 23:59:59");
$req->setRequestId("0df232dd4d757938");
$req->setExpId("123");
$req->setRtaSwitch("1");
$req->setAdConsume("123");
$req->setRtaExtraInfo("xxxxx");
$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.feed.opt.upload' \
-d 'partner_id=apidoc' \
-d 'sign=1B700D480A25A33BA16642E38ED25CD9' \
-d 'sign_method=hmac' \
-d 'timestamp=2025-01-16+00%3A44%3A23' \
-d 'v=2.0' \
-d 'account_id=111' \
-d 'ad_consume=123' \
-d 'behavior_time_stamp=2023-02-10+23%3A59%3A59' \
-d 'campaign_id=111' \
-d 'content_id=content_id' \
-d 'creative_id=111' \
-d 'device_id=0df232dd4d757938' \
-d 'device_type=12' \
-d 'event_id=111' \
-d 'exp_id=123' \
-d 'indicator_type=1' \
-d 'indicator_value=1' \
-d 'request_id=0df232dd4d757938' \
-d 'rta_extra_info=xxxxx' \
-d 'rta_switch=1' \
-d 'unit_id=111'
# -*- coding: utf-8 -*-
import top.api
req=top.api.TbkFeedOptUploadRequest(url,port)
req.set_app_info(top.appinfo(appkey,secret))
req.device_type=12
req.event_id=111
req.campaign_id="111"
req.content_id="content_id"
req.device_id="0df232dd4d757938"
req.creative_id="111"
req.account_id="111"
req.indicator_type=1
req.unit_id="111"
req.indicator_value=1
req.behavior_time_stamp="2023-02-10 23:59:59"
req.request_id="0df232dd4d757938"
req.exp_id="123"
req.rta_switch=1
req.ad_consume=123
req.rta_extra_info="xxxxx"
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.feed.opt.upload");
add_param(pRequest,"device_type","12");
add_param(pRequest,"event_id","111");
add_param(pRequest,"campaign_id","111");
add_param(pRequest,"content_id","content_id");
add_param(pRequest,"device_id","0df232dd4d757938");
add_param(pRequest,"creative_id","111");
add_param(pRequest,"account_id","111");
add_param(pRequest,"indicator_type","1");
add_param(pRequest,"unit_id","111");
add_param(pRequest,"indicator_value","1");
add_param(pRequest,"behavior_time_stamp","2023-02-10 23:59:59");
add_param(pRequest,"request_id","0df232dd4d757938");
add_param(pRequest,"exp_id","123");
add_param(pRequest,"rta_switch","1");
add_param(pRequest,"ad_consume","123");
add_param(pRequest,"rta_extra_info","xxxxx");
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.feed.opt.upload', {
'device_type':'12',
'event_id':'111',
'campaign_id':'111',
'content_id':'content_id',
'device_id':'0df232dd4d757938',
'creative_id':'111',
'account_id':'111',
'indicator_type':'1',
'unit_id':'111',
'indicator_value':'1',
'behavior_time_stamp':'2023-02-10 23:59:59',
'request_id':'0df232dd4d757938',
'exp_id':'123',
'rta_switch':'1',
'ad_consume':'123',
'rta_extra_info':'xxxxx'
}, function(error, response) {
if (!error) console.log(response);
else console.log(error);
})