TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
AlitripLocalplayProductUploadRequest req = new AlitripLocalplayProductUploadRequest();
req.setTripDay(1L);
req.setSubStock(0L);
req.setWapDesc("<wapDesc><shortDesc>标题1</shortDesc> <txt>描述1</txt> <img>图片路径1</img> <shortDesc>标题2</shortDesc> <txt>描述2</txt> <img>图片路径2</img> </wapDesc>");
req.setDescXml("<DESC><HIGHLIGHT><title>亮点1</title> <txt>亮点描述1</txt> <img>亮点图片链接1</img></HIGHLIGHT> <HIGHLIGHT><title>亮点2</title> <txt>亮点描述2</txt> <img>亮点图片链接2</img></HIGHLIGHT></DESC>");
req.setFeeExclude("费用不含1,费用不含2");
req.setOrderInfo("须知1,须知2");
req.setConfirmTime(1L);
req.setTitle("商品标题");
req.setRefundRegulations("30_30_0,30_15_5,14_7_15,6_4_70,3_1_85,1_1_90");
req.setConfirmType(1L);
req.setItemCustomTag("美食");
req.setOutProductId("1111");
req.setToLocations("东京,京都");
req.setTripNight(1L);
req.setPicUrls("https://img.daily.taobaocdn.net/imgextra/i3/2024098454/TB2C4VXXXXXXXc1XXXXXXXXXXXX_!!2024098454.jpg,http://ww1.sinaimg.cn/large/005EDdjYgw1fanv4d823dj31gs0z6qb8.jpg");
req.setItemId(12345L);
req.setReserveLimit("1_18_00");
req.setRefundType(0L);
req.setDescHtml("PC端详情描述");
req.setFromLocations("东京");
req.setSubTitles("亮点1,亮点2,亮点3");
req.setTouristServiceProvider("真实旅游服务提供商");
req.setTravellerTemplateId(111L);
req.setIsOverseasTour(0L);
req.setRefundRegulationsJson("[{\"firstDay\":-1,\"secondDay\":5,\"percent\":50,\"sellerPercent\":20},{\"firstDay\":4,\"secondDay\":1,\"percent\":80,\"sellerPercent\":50},{\"firstDay\":0,\"secondDay\":0,\"percent\":100,\"sellerPercent\":70},{\"firstDay\":0,\"secondDay\":0,\"percent\":100,\"sellerPercent\":90,\"isHoliday\":true}]");
req.setSellerCids("12344,24332");
req.setSecondKill("wap_only");
req.setHasDiscount(false);
AlitripLocalplayProductUploadResponse rsp = client.execute(req, sessionKey);
System.out.println(rsp.getBody());
ITopClient client = new DefaultTopClient(url, appkey, secret);
AlitripLocalplayProductUploadRequest req = new AlitripLocalplayProductUploadRequest();
req.TripDay = 1L;
req.SubStock = 0L;
req.WapDesc = "<wapDesc><shortDesc>标题1</shortDesc> <txt>描述1</txt> <img>图片路径1</img> <shortDesc>标题2</shortDesc> <txt>描述2</txt> <img>图片路径2</img> </wapDesc>";
req.DescXml = "<DESC><HIGHLIGHT><title>亮点1</title> <txt>亮点描述1</txt> <img>亮点图片链接1</img></HIGHLIGHT> <HIGHLIGHT><title>亮点2</title> <txt>亮点描述2</txt> <img>亮点图片链接2</img></HIGHLIGHT></DESC>";
req.FeeExclude = "费用不含1,费用不含2";
req.OrderInfo = "须知1,须知2";
req.ConfirmTime = 1L;
req.Title = "商品标题";
req.RefundRegulations = "30_30_0,30_15_5,14_7_15,6_4_70,3_1_85,1_1_90";
req.ConfirmType = 1L;
req.ItemCustomTag = "美食";
req.OutProductId = "1111";
req.ToLocations = "东京,京都";
req.TripNight = 1L;
req.PicUrls = "https://img.daily.taobaocdn.net/imgextra/i3/2024098454/TB2C4VXXXXXXXc1XXXXXXXXXXXX_!!2024098454.jpg,http://ww1.sinaimg.cn/large/005EDdjYgw1fanv4d823dj31gs0z6qb8.jpg";
req.ItemId = 12345L;
req.ReserveLimit = "1_18_00";
req.RefundType = 0L;
req.DescHtml = "PC端详情描述";
req.FromLocations = "东京";
req.SubTitles = "亮点1,亮点2,亮点3";
req.TouristServiceProvider = "真实旅游服务提供商";
req.TravellerTemplateId = 111L;
req.IsOverseasTour = 0L;
req.RefundRegulationsJson = "[{\"firstDay\":-1,\"secondDay\":5,\"percent\":50,\"sellerPercent\":20},{\"firstDay\":4,\"secondDay\":1,\"percent\":80,\"sellerPercent\":50},{\"firstDay\":0,\"secondDay\":0,\"percent\":100,\"sellerPercent\":70},{\"firstDay\":0,\"secondDay\":0,\"percent\":100,\"sellerPercent\":90,\"isHoliday\":true}]";
req.SellerCids = "12344,24332";
req.SecondKill = "wap_only";
req.HasDiscount = false;
AlitripLocalplayProductUploadResponse rsp = client.Execute(req, sessionKey);
Console.WriteLine(rsp.Body);
$c = new TopClient;
$c->appkey = $appkey;
$c->secretKey = $secret;
$req = new AlitripLocalplayProductUploadRequest;
$req->setTripDay("1");
$req->setSubStock("0");
$req->setWapDesc("<wapDesc><shortDesc>标题1</shortDesc> <txt>描述1</txt> <img>图片路径1</img> <shortDesc>标题2</shortDesc> <txt>描述2</txt> <img>图片路径2</img> </wapDesc>");
$req->setDescXml("<DESC><HIGHLIGHT><title>亮点1</title> <txt>亮点描述1</txt> <img>亮点图片链接1</img></HIGHLIGHT> <HIGHLIGHT><title>亮点2</title> <txt>亮点描述2</txt> <img>亮点图片链接2</img></HIGHLIGHT></DESC>");
$req->setFeeExclude("费用不含1,费用不含2");
$req->setOrderInfo("须知1,须知2");
$req->setConfirmTime("1");
$req->setTitle("商品标题");
$req->setRefundRegulations("30_30_0,30_15_5,14_7_15,6_4_70,3_1_85,1_1_90");
$req->setConfirmType("1");
$req->setItemCustomTag("美食");
$req->setOutProductId("1111");
$req->setToLocations("东京,京都");
$req->setTripNight("1");
$req->setPicUrls("https://img.daily.taobaocdn.net/imgextra/i3/2024098454/TB2C4VXXXXXXXc1XXXXXXXXXXXX_!!2024098454.jpg,http://ww1.sinaimg.cn/large/005EDdjYgw1fanv4d823dj31gs0z6qb8.jpg");
$req->setItemId("12345");
$req->setReserveLimit("1_18_00");
$req->setRefundType("0");
$req->setDescHtml("PC端详情描述");
$req->setFromLocations("东京");
$req->setSubTitles("亮点1,亮点2,亮点3");
$req->setTouristServiceProvider("真实旅游服务提供商");
$req->setTravellerTemplateId("111");
$req->setIsOverseasTour("0");
$req->setRefundRegulationsJson("[{\"firstDay\":-1,\"secondDay\":5,\"percent\":50,\"sellerPercent\":20},{\"firstDay\":4,\"secondDay\":1,\"percent\":80,\"sellerPercent\":50},{\"firstDay\":0,\"secondDay\":0,\"percent\":100,\"sellerPercent\":70},{\"firstDay\":0,\"secondDay\":0,\"percent\":100,\"sellerPercent\":90,\"isHoliday\":true}]");
$req->setSellerCids("12344,24332");
$req->setSecondKill("wap_only");
$req->setHasDiscount("false");
$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=alitrip.localplay.product.upload' \
-d 'partner_id=apidoc' \
-d 'session=d2887d52-3f8d-419e-958f-1c23023b54b4' \
-d 'sign=CCA40E528C5916FBD570FD15D0283A84' \
-d 'sign_method=hmac' \
-d 'timestamp=2024-11-23+21%3A39%3A59' \
-d 'v=2.0' \
-d 'confirm_time=1' \
-d 'confirm_type=1' \
-d 'desc_html=PC%E7%AB%AF%E8%AF%A6%E6%83%85%E6%8F%8F%E8%BF%B0' \
-d 'desc_xml=%3CDESC%3E%3CHIGHLIGHT%3E%3Ctitle%3E%E4%BA%AE%E7%82%B91%3C%2Ftitle%3E+%3Ctxt%3E%E4%BA%AE%E7%82%B9%E6%8F%8F%E8%BF%B01%3C%2Ftxt%3E+%3Cimg%3E%E4%BA%AE%E7%82%B9%E5%9B%BE%E7%89%87%E9%93%BE%E6%8E%A51%3C%2Fimg%3E%3C%2FHIGHLIGHT%3E+%3CHIGHLIGHT%3E%3Ctitle%3E%E4%BA%AE%E7%82%B92%3C%2Ftitle%3E+%3Ctxt%3E%E4%BA%AE%E7%82%B9%E6%8F%8F%E8%BF%B02%3C%2Ftxt%3E+%3Cimg%3E%E4%BA%AE%E7%82%B9%E5%9B%BE%E7%89%87%E9%93%BE%E6%8E%A52%3C%2Fimg%3E%3C%2FHIGHLIGHT%3E%3C%2FDESC%3E' \
-d 'fee_exclude=%E8%B4%B9%E7%94%A8%E4%B8%8D%E5%90%AB1%2C%E8%B4%B9%E7%94%A8%E4%B8%8D%E5%90%AB2' \
-d 'from_locations=%E4%B8%9C%E4%BA%AC' \
-d 'has_discount=false' \
-d 'is_overseas_tour=0' \
-d 'item_custom_tag=%E7%BE%8E%E9%A3%9F' \
-d 'item_id=12345' \
-d 'order_info=%E9%A1%BB%E7%9F%A51%2C%E9%A1%BB%E7%9F%A52' \
-d 'out_product_id=1111' \
-d 'pic_urls=https%3A%2F%2Fimg.daily.taobaocdn.net%2Fimgextra%2Fi3%2F2024098454%2FTB2C4VXXXXXXXc1XXXXXXXXXXXX_%21%212024098454.jpg%2Chttp%3A%2F%2Fww1.sinaimg.cn%2Flarge%2F005EDdjYgw1fanv4d823dj31gs0z6qb8.jpg' \
-d 'refund_regulations=30_30_0%2C30_15_5%2C14_7_15%2C6_4_70%2C3_1_85%2C1_1_90' \
-d 'refund_regulations_json=%7B%22firstDay%22%3A-1%2C%22secondDay%22%3A5%2C%22percent%22%3A50%2C%22sellerPercent%22%3A20%7D%2C%7B%22firstDay%22%3A4%2C%22secondDay%22%3A1%2C%22percent%22%3A80%2C%22sellerPercent%22%3A50%7D%2C%7B%22firstDay%22%3A0%2C%22secondDay%22%3A0%2C%22percent%22%3A100%2C%22sellerPercent%22%3A70%7D%2C%7B%22firstDay%22%3A0%2C%22secondDay%22%3A0%2C%22percent%22%3A100%2C%22sellerPercent%22%3A90%2C%22isHoliday%22%3Atrue%7D' \
-d 'refund_type=0' \
-d 'reserve_limit=1_18_00' \
-d 'second_kill=wap_only' \
-d 'seller_cids=12344%2C24332' \
-d 'sub_stock=0' \
-d 'sub_titles=%E4%BA%AE%E7%82%B91%2C%E4%BA%AE%E7%82%B92%2C%E4%BA%AE%E7%82%B93' \
-d 'title=%E5%95%86%E5%93%81%E6%A0%87%E9%A2%98' \
-d 'to_locations=%E4%B8%9C%E4%BA%AC%2C%E4%BA%AC%E9%83%BD' \
-d 'tourist_service_provider=%E7%9C%9F%E5%AE%9E%E6%97%85%E6%B8%B8%E6%9C%8D%E5%8A%A1%E6%8F%90%E4%BE%9B%E5%95%86' \
-d 'traveller_template_id=111' \
-d 'trip_day=1' \
-d 'trip_night=1' \
-d 'wap_desc=%3CwapDesc%3E%3CshortDesc%3E%E6%A0%87%E9%A2%981%3C%2FshortDesc%3E+%3Ctxt%3E%E6%8F%8F%E8%BF%B01%3C%2Ftxt%3E+%3Cimg%3E%E5%9B%BE%E7%89%87%E8%B7%AF%E5%BE%841%3C%2Fimg%3E+%3CshortDesc%3E%E6%A0%87%E9%A2%982%3C%2FshortDesc%3E+%3Ctxt%3E%E6%8F%8F%E8%BF%B02%3C%2Ftxt%3E+%3Cimg%3E%E5%9B%BE%E7%89%87%E8%B7%AF%E5%BE%842%3C%2Fimg%3E+%3C%2FwapDesc%3E'
# -*- coding: utf-8 -*-
import top.api
req=top.api.AlitripLocalplayProductUploadRequest(url,port)
req.set_app_info(top.appinfo(appkey,secret))
req.trip_day=1
req.sub_stock=0
req.wap_desc="<wapDesc><shortDesc>标题1</shortDesc> <txt>描述1</txt> <img>图片路径1</img> <shortDesc>标题2</shortDesc> <txt>描述2</txt> <img>图片路径2</img> </wapDesc>"
req.desc_xml="<DESC><HIGHLIGHT><title>亮点1</title> <txt>亮点描述1</txt> <img>亮点图片链接1</img></HIGHLIGHT> <HIGHLIGHT><title>亮点2</title> <txt>亮点描述2</txt> <img>亮点图片链接2</img></HIGHLIGHT></DESC>"
req.fee_exclude="费用不含1,费用不含2"
req.order_info="须知1,须知2"
req.confirm_time=1
req.title="商品标题"
req.refund_regulations="30_30_0,30_15_5,14_7_15,6_4_70,3_1_85,1_1_90"
req.confirm_type=1
req.item_custom_tag="美食"
req.out_product_id="1111"
req.to_locations="东京,京都"
req.trip_night=1
req.pic_urls="https://img.daily.taobaocdn.net/imgextra/i3/2024098454/TB2C4VXXXXXXXc1XXXXXXXXXXXX_!!2024098454.jpg,http://ww1.sinaimg.cn/large/005EDdjYgw1fanv4d823dj31gs0z6qb8.jpg"
req.item_id=12345
req.reserve_limit="1_18_00"
req.refund_type=0
req.desc_html="PC端详情描述"
req.from_locations="东京"
req.sub_titles="亮点1,亮点2,亮点3"
req.tourist_service_provider="真实旅游服务提供商"
req.traveller_template_id=111
req.is_overseas_tour=0
req.refund_regulations_json="[{\"firstDay\":-1,\"secondDay\":5,\"percent\":50,\"sellerPercent\":20},{\"firstDay\":4,\"secondDay\":1,\"percent\":80,\"sellerPercent\":50},{\"firstDay\":0,\"secondDay\":0,\"percent\":100,\"sellerPercent\":70},{\"firstDay\":0,\"secondDay\":0,\"percent\":100,\"sellerPercent\":90,\"isHoliday\":true}]"
req.seller_cids="12344,24332"
req.second_kill="wap_only"
req.has_discount=false
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,"alitrip.localplay.product.upload");
add_param(pRequest,"trip_day","1");
add_param(pRequest,"sub_stock","0");
add_param(pRequest,"wap_desc","<wapDesc><shortDesc>标题1</shortDesc> <txt>描述1</txt> <img>图片路径1</img> <shortDesc>标题2</shortDesc> <txt>描述2</txt> <img>图片路径2</img> </wapDesc>");
add_param(pRequest,"desc_xml","<DESC><HIGHLIGHT><title>亮点1</title> <txt>亮点描述1</txt> <img>亮点图片链接1</img></HIGHLIGHT> <HIGHLIGHT><title>亮点2</title> <txt>亮点描述2</txt> <img>亮点图片链接2</img></HIGHLIGHT></DESC>");
add_param(pRequest,"fee_exclude","费用不含1,费用不含2");
add_param(pRequest,"order_info","须知1,须知2");
add_param(pRequest,"confirm_time","1");
add_param(pRequest,"title","商品标题");
add_param(pRequest,"refund_regulations","30_30_0,30_15_5,14_7_15,6_4_70,3_1_85,1_1_90");
add_param(pRequest,"confirm_type","1");
add_param(pRequest,"item_custom_tag","美食");
add_param(pRequest,"out_product_id","1111");
add_param(pRequest,"to_locations","东京,京都");
add_param(pRequest,"trip_night","1");
add_param(pRequest,"pic_urls","https://img.daily.taobaocdn.net/imgextra/i3/2024098454/TB2C4VXXXXXXXc1XXXXXXXXXXXX_!!2024098454.jpg,http://ww1.sinaimg.cn/large/005EDdjYgw1fanv4d823dj31gs0z6qb8.jpg");
add_param(pRequest,"item_id","12345");
add_param(pRequest,"reserve_limit","1_18_00");
add_param(pRequest,"refund_type","0");
add_param(pRequest,"desc_html","PC端详情描述");
add_param(pRequest,"from_locations","东京");
add_param(pRequest,"sub_titles","亮点1,亮点2,亮点3");
add_param(pRequest,"tourist_service_provider","真实旅游服务提供商");
add_param(pRequest,"traveller_template_id","111");
add_param(pRequest,"is_overseas_tour","0");
add_param(pRequest,"refund_regulations_json","{"firstDay":-1,"secondDay":5,"percent":50,"sellerPercent":20},{"firstDay":4,"secondDay":1,"percent":80,"sellerPercent":50},{"firstDay":0,"secondDay":0,"percent":100,"sellerPercent":70},{"firstDay":0,"secondDay":0,"percent":100,"sellerPercent":90,"isHoliday":true}");
add_param(pRequest,"seller_cids","12344,24332");
add_param(pRequest,"second_kill","wap_only");
add_param(pRequest,"has_discount","false");
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('alitrip.localplay.product.upload', {
'trip_day':'1',
'sub_stock':'0',
'wap_desc':'<wapDesc><shortDesc>标题1</shortDesc> <txt>描述1</txt> <img>图片路径1</img> <shortDesc>标题2</shortDesc> <txt>描述2</txt> <img>图片路径2</img> </wapDesc>',
'desc_xml':'<DESC><HIGHLIGHT><title>亮点1</title> <txt>亮点描述1</txt> <img>亮点图片链接1</img></HIGHLIGHT> <HIGHLIGHT><title>亮点2</title> <txt>亮点描述2</txt> <img>亮点图片链接2</img></HIGHLIGHT></DESC>',
'fee_exclude':'费用不含1,费用不含2',
'order_info':'须知1,须知2',
'confirm_time':'1',
'title':'商品标题',
'refund_regulations':'30_30_0,30_15_5,14_7_15,6_4_70,3_1_85,1_1_90',
'confirm_type':'1',
'item_custom_tag':'美食',
'out_product_id':'1111',
'to_locations':'东京,京都',
'trip_night':'1',
'pic_urls':'https://img.daily.taobaocdn.net/imgextra/i3/2024098454/TB2C4VXXXXXXXc1XXXXXXXXXXXX_!!2024098454.jpg,http://ww1.sinaimg.cn/large/005EDdjYgw1fanv4d823dj31gs0z6qb8.jpg',
'item_id':'12345',
'reserve_limit':'1_18_00',
'refund_type':'0',
'desc_html':'PC端详情描述',
'from_locations':'东京',
'sub_titles':'亮点1,亮点2,亮点3',
'tourist_service_provider':'真实旅游服务提供商',
'traveller_template_id':'111',
'is_overseas_tour':'0',
'refund_regulations_json':'{"firstDay":-1,"secondDay":5,"percent":50,"sellerPercent":20},{"firstDay":4,"secondDay":1,"percent":80,"sellerPercent":50},{"firstDay":0,"secondDay":0,"percent":100,"sellerPercent":70},{"firstDay":0,"secondDay":0,"percent":100,"sellerPercent":90,"isHoliday":true}',
'seller_cids':'12344,24332',
'second_kill':'wap_only',
'has_discount':'false'
}, function(error, response) {
if (!error) console.log(response);
else console.log(error);
})