TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
AlitripTravelHotelticketProductProductupdatepushRequest req = new AlitripTravelHotelticketProductProductupdatepushRequest();
req.setAccessKey("ak1234");
AlitripTravelHotelticketProductProductupdatepushRequest.ProductUpdatePushDTO obj1 = new AlitripTravelHotelticketProductProductupdatepushRequest.ProductUpdatePushDTO();
List<AlitripTravelHotelticketProductProductupdatepushRequest.ProductPriceStockDTO> list3 = new ArrayList<AlitripTravelHotelticketProductProductupdatepushRequest.ProductPriceStockDTO>();
AlitripTravelHotelticketProductProductupdatepushRequest.ProductPriceStockDTO obj4 = new AlitripTravelHotelticketProductProductupdatepushRequest.ProductPriceStockDTO();
list3.add(obj4);
obj4.setDate("2022-05-02");
List<AlitripTravelHotelticketProductProductupdatepushRequest.ProductSessionDTO> list7 = new ArrayList<AlitripTravelHotelticketProductProductupdatepushRequest.ProductSessionDTO>();
AlitripTravelHotelticketProductProductupdatepushRequest.ProductSessionDTO obj8 = new AlitripTravelHotelticketProductProductupdatepushRequest.ProductSessionDTO();
list7.add(obj8);
obj8.setStartTime("15:00");
obj8.setSessionId("s1111");
obj8.setEndTime("17:30");
obj8.setStock(30L);
obj8.setWholesalePrice(1500L);
obj8.setRetailPrice(1800L);
list5.setSessions(list7);
obj4.setCanSell(true);
obj4.setStock(100L);
obj4.setWholesalePrice(1500L);
obj4.setRetailPrice(1800L);
obj1.setPriceStocks(list3);
obj1.setNotifyType(1L);
obj1.setProductId("prd13241");
obj1.setBedId("b1");
obj1.setHotelId("h1");
obj1.setRoomId("r1");
obj1.setExtendParamsString("{\"example\": \"例子\"}");
obj1.setMode(1L);
req.setProductUpdates(obj1);
AlitripTravelHotelticketProductProductupdatepushResponse rsp = client.execute(req);
System.out.println(rsp.getBody());
ITopClient client = new DefaultTopClient(url, appkey, secret);
AlitripTravelHotelticketProductProductupdatepushRequest req = new AlitripTravelHotelticketProductProductupdatepushRequest();
req.AccessKey = "ak1234";
AlitripTravelHotelticketProductProductupdatepushRequest.ProductUpdatePushDTODomain obj1 = new AlitripTravelHotelticketProductProductupdatepushRequest.ProductUpdatePushDTODomain();
List<AlitripTravelHotelticketProductProductupdatepushRequest.ProductPriceStockDTODomain> list3 = new List<AlitripTravelHotelticketProductProductupdatepushRequest.ProductPriceStockDTODomain>();
AlitripTravelHotelticketProductProductupdatepushRequest.ProductPriceStockDTODomain obj4 = new AlitripTravelHotelticketProductProductupdatepushRequest.ProductPriceStockDTODomain();
list3.Add(obj4);
obj4.Date = "2022-05-02";
List<AlitripTravelHotelticketProductProductupdatepushRequest.ProductSessionDTODomain> list6 = new List<AlitripTravelHotelticketProductProductupdatepushRequest.ProductSessionDTODomain>();
AlitripTravelHotelticketProductProductupdatepushRequest.ProductSessionDTODomain obj7 = new AlitripTravelHotelticketProductProductupdatepushRequest.ProductSessionDTODomain();
list6.Add(obj7);
obj7.StartTime = "15:00";
obj7.SessionId = "s1111";
obj7.EndTime = "17:30";
obj7.Stock = 30L;
obj7.WholesalePrice = 1500L;
obj7.RetailPrice = 1800L;
obj4.Sessions= list6;
obj4.CanSell = true;
obj4.Stock = 100L;
obj4.WholesalePrice = 1500L;
obj4.RetailPrice = 1800L;
obj1.PriceStocks= list3;
obj1.NotifyType = 1L;
obj1.ProductId = "prd13241";
obj1.BedId = "b1";
obj1.HotelId = "h1";
obj1.RoomId = "r1";
obj1.ExtendParams = "{\"example\": \"例子\"}";
obj1.Mode = 1L;
req.ProductUpdates_ = obj1;
AlitripTravelHotelticketProductProductupdatepushResponse rsp = client.Execute(req);
Console.WriteLine(rsp.Body);
$c = new TopClient;
$c->appkey = $appkey;
$c->secretKey = $secret;
$req = new AlitripTravelHotelticketProductProductupdatepushRequest;
$req->setAccessKey("ak1234");
$product_updates = new ProductUpdatePushDTO;
$price_stocks = new ProductPriceStockDTO;
$price_stocks->date="2022-05-02";
$sessions = new ProductSessionDTO;
$sessions->start_time="15:00";
$sessions->session_id="s1111";
$sessions->end_time="17:30";
$sessions->stock="30";
$sessions->wholesale_price="1500";
$sessions->retail_price="1800";
$price_stocks->sessions = $sessions;
$price_stocks->can_sell="true";
$price_stocks->stock="100";
$price_stocks->wholesale_price="1500";
$price_stocks->retail_price="1800";
$product_updates->price_stocks = $price_stocks;
$product_updates->notify_type="1";
$product_updates->product_id="prd13241";
$product_updates->bed_id="b1";
$product_updates->hotel_id="h1";
$product_updates->room_id="r1";
$product_updates->extend_params=json_decode("{\"example\": \"例子\"}");
$product_updates->mode="1";
$req->setProductUpdates(json_encode($product_updates));
$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=alitrip.travel.hotelticket.product.productupdatepush' \
-d 'partner_id=apidoc' \
-d 'sign=8BDABE466262C7ADCE50131EB240E8B8' \
-d 'sign_method=hmac' \
-d 'timestamp=2024-12-05+03%3A12%3A39' \
-d 'v=2.0' \
-d 'access_key=ak1234' \
-d 'product_updates=null'
# -*- coding: utf-8 -*-
import top.api
req=top.api.AlitripTravelHotelticketProductProductupdatepushRequest(url,port)
req.set_app_info(top.appinfo(appkey,secret))
req.access_key="ak1234"
req.product_updates="数据结构示例JSON格式"
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,"alitrip.travel.hotelticket.product.productupdatepush");
add_param(pRequest,"access_key","ak1234");
add_param(pRequest,"product_updates","数据结构JSON示例");
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('alitrip.travel.hotelticket.product.productupdatepush', {
'access_key':'ak1234',
'product_updates':'数据结构JSON示例'
}, function(error, response) {
if (!error) console.log(response);
else console.log(error);
})