TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
XhotelRatesIncrementRequest req = new XhotelRatesIncrementRequest();
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}]}}]");
XhotelRatesIncrementResponse rsp = client.execute(req, sessionKey);
System.out.println(rsp.getBody());
ITopClient client = new DefaultTopClient(url, appkey, secret);
XhotelRatesIncrementRequest req = new XhotelRatesIncrementRequest();
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}]}}]";
XhotelRatesIncrementResponse rsp = client.Execute(req, sessionKey);
Console.WriteLine(rsp.Body);
$c = new TopClient;
$c->appkey = $appkey;
$c->secretKey = $secret;
$req = new XhotelRatesIncrementRequest;
$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.increment' \
-d 'partner_id=apidoc' \
-d 'session=59b622a0-9f06-446e-bf40-122c5808d803' \
-d 'sign=D5C37E425BA936C662BFDB7ACC061FAF' \
-d 'sign_method=hmac' \
-d 'timestamp=2024-11-21+21%3A03%3A33' \
-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.XhotelRatesIncrementRequest(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.increment");
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.increment', {
'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);
})