TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
XhotelRatesLiteIncrUpdateRequest req = new XhotelRatesLiteIncrUpdateRequest();
req.setRateListInvInfo("[{\"rp_code\":\"031612_181220000074_F1_1\",\"out_rid\":\"031612_HD\",\"vendor\":\"taobao\",\"useRoomInv\":0,\"invAndSwitch\":[{\"date\":\"2020-01-09\",\"price\":1200,\"quota\":23,\"rateStatus\":1},{\"date\":\"2020-01-10\",\"price\":1200,\"quota\":23,\"rateStatus\":0}]},{\"rp_code\":\"1234\",\"out_rid\":\"123456\",\"vendor\":\"taobao\",\"useRoomInv\":0,\"invAndSwitch\":[{\"date\":\"yyyy-MM-dd\",\"price\":1200,\"quota\":23,\"rateStatus\":1},{\"date\":\"yyyy-MM-dd\",\"price\":1200,\"quota\":23,\"rateStatus\":1}]}]");
XhotelRatesLiteIncrUpdateResponse rsp = client.execute(req, sessionKey);
System.out.println(rsp.getBody());
ITopClient client = new DefaultTopClient(url, appkey, secret);
XhotelRatesLiteIncrUpdateRequest req = new XhotelRatesLiteIncrUpdateRequest();
req.RateListInvInfo = "[{\"rp_code\":\"031612_181220000074_F1_1\",\"out_rid\":\"031612_HD\",\"vendor\":\"taobao\",\"useRoomInv\":0,\"invAndSwitch\":[{\"date\":\"2020-01-09\",\"price\":1200,\"quota\":23,\"rateStatus\":1},{\"date\":\"2020-01-10\",\"price\":1200,\"quota\":23,\"rateStatus\":0}]},{\"rp_code\":\"1234\",\"out_rid\":\"123456\",\"vendor\":\"taobao\",\"useRoomInv\":0,\"invAndSwitch\":[{\"date\":\"yyyy-MM-dd\",\"price\":1200,\"quota\":23,\"rateStatus\":1},{\"date\":\"yyyy-MM-dd\",\"price\":1200,\"quota\":23,\"rateStatus\":1}]}]";
XhotelRatesLiteIncrUpdateResponse rsp = client.Execute(req, sessionKey);
Console.WriteLine(rsp.Body);
$c = new TopClient;
$c->appkey = $appkey;
$c->secretKey = $secret;
$req = new XhotelRatesLiteIncrUpdateRequest;
$req->setRateListInvInfo("[{\"rp_code\":\"031612_181220000074_F1_1\",\"out_rid\":\"031612_HD\",\"vendor\":\"taobao\",\"useRoomInv\":0,\"invAndSwitch\":[{\"date\":\"2020-01-09\",\"price\":1200,\"quota\":23,\"rateStatus\":1},{\"date\":\"2020-01-10\",\"price\":1200,\"quota\":23,\"rateStatus\":0}]},{\"rp_code\":\"1234\",\"out_rid\":\"123456\",\"vendor\":\"taobao\",\"useRoomInv\":0,\"invAndSwitch\":[{\"date\":\"yyyy-MM-dd\",\"price\":1200,\"quota\":23,\"rateStatus\":1},{\"date\":\"yyyy-MM-dd\",\"price\":1200,\"quota\":23,\"rateStatus\":1}]}]");
$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.lite.incr.update' \
-d 'partner_id=apidoc' \
-d 'session=8679a32b-b2c6-4ace-8db6-254f7ab80ee8' \
-d 'sign=5B7E4560D94487B00C77AAAB9852E031' \
-d 'sign_method=hmac' \
-d 'timestamp=2024-11-23+17%3A36%3A03' \
-d 'v=2.0' \
-d 'rate_list_inv_info=%7B%22rp_code%22%3A%22031612_181220000074_F1_1%22%2C%22out_rid%22%3A%22031612_HD%22%2C%22vendor%22%3A%22taobao%22%2C%22useRoomInv%22%3A0%2C%22invAndSwitch%22%3A%5B%7B%22date%22%3A%222020-01-09%22%2C%22price%22%3A1200%2C%22quota%22%3A23%2C%22rateStatus%22%3A1%7D%2C%7B%22date%22%3A%222020-01-10%22%2C%22price%22%3A1200%2C%22quota%22%3A23%2C%22rateStatus%22%3A0%7D%5D%7D%2C%7B%22rp_code%22%3A%221234%22%2C%22out_rid%22%3A%22123456%22%2C%22vendor%22%3A%22taobao%22%2C%22useRoomInv%22%3A0%2C%22invAndSwitch%22%3A%5B%7B%22date%22%3A%22yyyy-MM-dd%22%2C%22price%22%3A1200%2C%22quota%22%3A23%2C%22rateStatus%22%3A1%7D%2C%7B%22date%22%3A%22yyyy-MM-dd%22%2C%22price%22%3A1200%2C%22quota%22%3A23%2C%22rateStatus%22%3A1%7D%5D%7D'
# -*- coding: utf-8 -*-
import top.api
req=top.api.XhotelRatesLiteIncrUpdateRequest(url,port)
req.set_app_info(top.appinfo(appkey,secret))
req.rate_list_inv_info="[{\"rp_code\":\"031612_181220000074_F1_1\",\"out_rid\":\"031612_HD\",\"vendor\":\"taobao\",\"useRoomInv\":0,\"invAndSwitch\":[{\"date\":\"2020-01-09\",\"price\":1200,\"quota\":23,\"rateStatus\":1},{\"date\":\"2020-01-10\",\"price\":1200,\"quota\":23,\"rateStatus\":0}]},{\"rp_code\":\"1234\",\"out_rid\":\"123456\",\"vendor\":\"taobao\",\"useRoomInv\":0,\"invAndSwitch\":[{\"date\":\"yyyy-MM-dd\",\"price\":1200,\"quota\":23,\"rateStatus\":1},{\"date\":\"yyyy-MM-dd\",\"price\":1200,\"quota\":23,\"rateStatus\":1}]}]"
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.lite.incr.update");
add_param(pRequest,"rate_list_inv_info","{"rp_code":"031612_181220000074_F1_1","out_rid":"031612_HD","vendor":"taobao","useRoomInv":0,"invAndSwitch":[{"date":"2020-01-09","price":1200,"quota":23,"rateStatus":1},{"date":"2020-01-10","price":1200,"quota":23,"rateStatus":0}]},{"rp_code":"1234","out_rid":"123456","vendor":"taobao","useRoomInv":0,"invAndSwitch":[{"date":"yyyy-MM-dd","price":1200,"quota":23,"rateStatus":1},{"date":"yyyy-MM-dd","price":1200,"quota":23,"rateStatus":1}]}");
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.lite.incr.update', {
'rate_list_inv_info':'{"rp_code":"031612_181220000074_F1_1","out_rid":"031612_HD","vendor":"taobao","useRoomInv":0,"invAndSwitch":[{"date":"2020-01-09","price":1200,"quota":23,"rateStatus":1},{"date":"2020-01-10","price":1200,"quota":23,"rateStatus":0}]},{"rp_code":"1234","out_rid":"123456","vendor":"taobao","useRoomInv":0,"invAndSwitch":[{"date":"yyyy-MM-dd","price":1200,"quota":23,"rateStatus":1},{"date":"yyyy-MM-dd","price":1200,"quota":23,"rateStatus":1}]}'
}, function(error, response) {
if (!error) console.log(response);
else console.log(error);
})