TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
XhotelRatesUpdateRequest req = new XhotelRatesUpdateRequest();
req.setRateInventoryPriceMap("[{\"out_rid\":\"ABCDE_123\",\"rateplan_code\":\"ABCDE_WHL01\",\"vendor\":\"\",\"lock_start_time\":\"\",\"lock_end_time\":\"\",\"data\":{\"use_room_inventory\":false,\"inventory_price\":[{\"date\":\"2013-11-18\",\"quota\":1,\"price\":1000,\"status\":1},{\"date\":\"2013-11-19\",\"quota\":1,\"price\":1000,\"status\":0}]}},{\"out_rid\":\"ABCDE_234\",\"rateplan_code\":\"ABCDE_WHL01\",\"vendor\":\"\",\"data\":{\"use_room_inventory\":false,\"inventory_price\":[{\"date\":\"2013-11-18\",\"quota\":1,\"price\":1000,\"status\":1},{\"date\":\"2013-11-19\",\"quota\":1,\"price\":1000,\"status\":0}]}}]");
XhotelRatesUpdateResponse rsp = client.execute(req, sessionKey);
System.out.println(rsp.getBody());
ITopClient client = new DefaultTopClient(url, appkey, secret);
XhotelRatesUpdateRequest req = new XhotelRatesUpdateRequest();
req.RateInventoryPriceMap = "[{\"out_rid\":\"ABCDE_123\",\"rateplan_code\":\"ABCDE_WHL01\",\"vendor\":\"\",\"lock_start_time\":\"\",\"lock_end_time\":\"\",\"data\":{\"use_room_inventory\":false,\"inventory_price\":[{\"date\":\"2013-11-18\",\"quota\":1,\"price\":1000,\"status\":1},{\"date\":\"2013-11-19\",\"quota\":1,\"price\":1000,\"status\":0}]}},{\"out_rid\":\"ABCDE_234\",\"rateplan_code\":\"ABCDE_WHL01\",\"vendor\":\"\",\"data\":{\"use_room_inventory\":false,\"inventory_price\":[{\"date\":\"2013-11-18\",\"quota\":1,\"price\":1000,\"status\":1},{\"date\":\"2013-11-19\",\"quota\":1,\"price\":1000,\"status\":0}]}}]";
XhotelRatesUpdateResponse rsp = client.Execute(req, sessionKey);
Console.WriteLine(rsp.Body);
$c = new TopClient;
$c->appkey = $appkey;
$c->secretKey = $secret;
$req = new XhotelRatesUpdateRequest;
$req->setRateInventoryPriceMap("[{\"out_rid\":\"ABCDE_123\",\"rateplan_code\":\"ABCDE_WHL01\",\"vendor\":\"\",\"lock_start_time\":\"\",\"lock_end_time\":\"\",\"data\":{\"use_room_inventory\":false,\"inventory_price\":[{\"date\":\"2013-11-18\",\"quota\":1,\"price\":1000,\"status\":1},{\"date\":\"2013-11-19\",\"quota\":1,\"price\":1000,\"status\":0}]}},{\"out_rid\":\"ABCDE_234\",\"rateplan_code\":\"ABCDE_WHL01\",\"vendor\":\"\",\"data\":{\"use_room_inventory\":false,\"inventory_price\":[{\"date\":\"2013-11-18\",\"quota\":1,\"price\":1000,\"status\":1},{\"date\":\"2013-11-19\",\"quota\":1,\"price\":1000,\"status\":0}]}}]");
$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=taobao.xhotel.rates.update' \
-d 'partner_id=apidoc' \
-d 'session=1da12ac6-c848-403e-bbbd-dd35bdc919a5' \
-d 'sign=328AAB5E20B14A24F3F4BF37E939AF5C' \
-d 'sign_method=hmac' \
-d 'timestamp=2024-11-21+20%3A27%3A48' \
-d 'v=2.0' \
-d 'rate_inventory_price_map=%7B%22out_rid%22%3A%22ABCDE_123%22%2C%22rateplan_code%22%3A%22ABCDE_WHL01%22%2C%22vendor%22%3A%22%22%2C%22lock_start_time%22%3A%22%22%2C%22lock_end_time%22%3A%22%22%2C%22data%22%3A%7B%22use_room_inventory%22%3Afalse%2C%22inventory_price%22%3A%5B%7B%22date%22%3A%222013-11-18%22%2C%22quota%22%3A1%2C%22price%22%3A1000%2C%22status%22%3A1%7D%2C%7B%22date%22%3A%222013-11-19%22%2C%22quota%22%3A1%2C%22price%22%3A1000%2C%22status%22%3A0%7D%5D%7D%7D%2C%7B%22out_rid%22%3A%22ABCDE_234%22%2C%22rateplan_code%22%3A%22ABCDE_WHL01%22%2C%22vendor%22%3A%22%22%2C%22data%22%3A%7B%22use_room_inventory%22%3Afalse%2C%22inventory_price%22%3A%5B%7B%22date%22%3A%222013-11-18%22%2C%22quota%22%3A1%2C%22price%22%3A1000%2C%22status%22%3A1%7D%2C%7B%22date%22%3A%222013-11-19%22%2C%22quota%22%3A1%2C%22price%22%3A1000%2C%22status%22%3A0%7D%5D%7D%7D'
# -*- coding: utf-8 -*-
import top.api
req=top.api.XhotelRatesUpdateRequest(url,port)
req.set_app_info(top.appinfo(appkey,secret))
req.rate_inventory_price_map="[{\"out_rid\":\"ABCDE_123\",\"rateplan_code\":\"ABCDE_WHL01\",\"vendor\":\"\",\"lock_start_time\":\"\",\"lock_end_time\":\"\",\"data\":{\"use_room_inventory\":false,\"inventory_price\":[{\"date\":\"2013-11-18\",\"quota\":1,\"price\":1000,\"status\":1},{\"date\":\"2013-11-19\",\"quota\":1,\"price\":1000,\"status\":0}]}},{\"out_rid\":\"ABCDE_234\",\"rateplan_code\":\"ABCDE_WHL01\",\"vendor\":\"\",\"data\":{\"use_room_inventory\":false,\"inventory_price\":[{\"date\":\"2013-11-18\",\"quota\":1,\"price\":1000,\"status\":1},{\"date\":\"2013-11-19\",\"quota\":1,\"price\":1000,\"status\":0}]}}]"
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,"taobao.xhotel.rates.update");
add_param(pRequest,"rate_inventory_price_map","{"out_rid":"ABCDE_123","rateplan_code":"ABCDE_WHL01","vendor":"","lock_start_time":"","lock_end_time":"","data":{"use_room_inventory":false,"inventory_price":[{"date":"2013-11-18","quota":1,"price":1000,"status":1},{"date":"2013-11-19","quota":1,"price":1000,"status":0}]}},{"out_rid":"ABCDE_234","rateplan_code":"ABCDE_WHL01","vendor":"","data":{"use_room_inventory":false,"inventory_price":[{"date":"2013-11-18","quota":1,"price":1000,"status":1},{"date":"2013-11-19","quota":1,"price":1000,"status":0}]}}");
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('taobao.xhotel.rates.update', {
'rate_inventory_price_map':'{"out_rid":"ABCDE_123","rateplan_code":"ABCDE_WHL01","vendor":"","lock_start_time":"","lock_end_time":"","data":{"use_room_inventory":false,"inventory_price":[{"date":"2013-11-18","quota":1,"price":1000,"status":1},{"date":"2013-11-19","quota":1,"price":1000,"status":0}]}},{"out_rid":"ABCDE_234","rateplan_code":"ABCDE_WHL01","vendor":"","data":{"use_room_inventory":false,"inventory_price":[{"date":"2013-11-18","quota":1,"price":1000,"status":1},{"date":"2013-11-19","quota":1,"price":1000,"status":0}]}}'
}, function(error, response) {
if (!error) console.log(response);
else console.log(error);
})