pTopRequest pRequest = alloc_top_request();
pTopResponse pResponse = NULL;
pTaobaoClient pClient = alloc_taobao_client(url, appkey, appsecret);
set_api_name(pRequest,"taobao.tbk.content.material.save");
add_param(pRequest,"add_on_items","pBdZOatxtA2JAatxRHptm-M8X3qWt4MK8mpxtB");
add_param(pRequest,"boom_start_time","2023-01-01 00:00:00");
add_param(pRequest,"boom_end_time","2023-01-01 00:00:00");
add_param(pRequest,"text_materials","文字素材");
add_param(pRequest,"cont_id","媒体内容Id");
add_param(pRequest,"price_tag","全网好价");
add_param(pRequest,"title","奥妙洗衣液50g*2瓶优惠价9.9元");
add_param(pRequest,"discount_rank","A");
add_param(pRequest,"professional_tag","0");
add_param(pRequest,"scene","1");
add_param(pRequest,"item_discount_count","2");
add_param(pRequest,"positive_feedback_count","100");
add_param(pRequest,"offline_code","0");
add_param(pRequest,"boom_price","9.99");
add_param(pRequest,"boom_type","1");
add_param(pRequest,"content_type","1");
add_param(pRequest,"price_structure","买2件打5折");
add_param(pRequest,"publisher_nick_name","每日好物推荐");
add_param(pRequest,"negative_feedback_count","100");
add_param(pRequest,"origin_time","2023-01-01 00:00:00");
add_param(pRequest,"content_tag","母婴好物");
add_param(pRequest,"pre_commission_rate","15");
add_param(pRequest,"coupon_url","https://uland.taobao.com");
add_param(pRequest,"selling_point","有效除菌,气味清新");
add_param(pRequest,"boom_id","855");
add_param(pRequest,"item_id","qYtxrMJOC8tmtM-Qq0Z65Sbbq5DqZ9");
add_param(pRequest,"activity_url","https://s.click.taobao.com");
add_param(pRequest,"pic_materials","abc");
add_param(pRequest,"publisher_avatar","abc");
add_param(pRequest,"operation","2");
add_param(pRequest,"pre_view_pic","abc");
add_param(pRequest,"content_generate_type","1");
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.content.material.save', {
'add_on_items':'pBdZOatxtA2JAatxRHptm-M8X3qWt4MK8mpxtB',
'boom_start_time':'2023-01-01 00:00:00',
'boom_end_time':'2023-01-01 00:00:00',
'text_materials':'文字素材',
'cont_id':'媒体内容Id',
'price_tag':'全网好价',
'title':'奥妙洗衣液50g*2瓶优惠价9.9元',
'discount_rank':'A',
'professional_tag':'0',
'scene':'1',
'item_discount_count':'2',
'positive_feedback_count':'100',
'offline_code':'0',
'boom_price':'9.99',
'boom_type':'1',
'content_type':'1',
'price_structure':'买2件打5折',
'publisher_nick_name':'每日好物推荐',
'negative_feedback_count':'100',
'origin_time':'2023-01-01 00:00:00',
'content_tag':'母婴好物',
'pre_commission_rate':'15',
'coupon_url':'https://uland.taobao.com',
'selling_point':'有效除菌,气味清新',
'boom_id':'855',
'item_id':'qYtxrMJOC8tmtM-Qq0Z65Sbbq5DqZ9',
'activity_url':'https://s.click.taobao.com',
'pic_materials':'abc',
'publisher_avatar':'abc',
'operation':'2',
'pre_view_pic':'abc',
'content_generate_type':'1'
}, function(error, response) {
if (!error) console.log(response);
else console.log(error);
})