pTopRequest pRequest = alloc_top_request();
pTopResponse pResponse = NULL;
pTaobaoClient pClient = alloc_taobao_client(url, appkey, appsecret);
set_api_name(pRequest,"taobao.tbk.feed.track.upload");
add_param(pRequest,"caid_md5","caidmd5");
add_param(pRequest,"event_id","12345");
add_param(pRequest,"oaid_md5","oaidmd5");
add_param(pRequest,"os","1");
add_param(pRequest,"idfa","idfa");
add_param(pRequest,"content_id","123");
add_param(pRequest,"traffic_type","1");
add_param(pRequest,"opt_type","1");
add_param(pRequest,"biz","shangdan");
add_param(pRequest,"ad_type","1");
add_param(pRequest,"idfa_md5","abc123");
add_param(pRequest,"caid","abc123");
add_param(pRequest,"imei_md5","abc123");
add_param(pRequest,"imei","abc123");
add_param(pRequest,"id","abc123");
add_param(pRequest,"behaviour_type","1");
add_param(pRequest,"oaid","abc123");
add_param(pRequest,"time","1718873189000");
add_param(pRequest,"campaign_id","abc123");
add_param(pRequest,"unit_id","abc123");
add_param(pRequest,"creative_id","abc123");
add_param(pRequest,"account_id","abc123");
add_param(pRequest,"ip","0.0.0.0");
add_param(pRequest,"ua","user-agent");
add_param(pRequest,"model","iphone15Pro");
add_param(pRequest,"star_id","abc123");
add_param(pRequest,"callback_url","www.xxx.com");
add_param(pRequest,"landing","www.xxx.com");
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.track.upload', {
'caid_md5':'caidmd5',
'event_id':'12345',
'oaid_md5':'oaidmd5',
'os':'1',
'idfa':'idfa',
'content_id':'123',
'traffic_type':'1',
'opt_type':'1',
'biz':'shangdan',
'ad_type':'1',
'idfa_md5':'abc123',
'caid':'abc123',
'imei_md5':'abc123',
'imei':'abc123',
'id':'abc123',
'behaviour_type':'1',
'oaid':'abc123',
'time':'1718873189000',
'campaign_id':'abc123',
'unit_id':'abc123',
'creative_id':'abc123',
'account_id':'abc123',
'ip':'0.0.0.0',
'ua':'user-agent',
'model':'iphone15Pro',
'star_id':'abc123',
'callback_url':'www.xxx.com',
'landing':'www.xxx.com'
}, function(error, response) {
if (!error) console.log(response);
else console.log(error);
})