TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
XhotelRoomsUpdateRequest req = new XhotelRoomsUpdateRequest();
req.setRoomQuotaMap("[{\"out_rid\":\"hotel1_roomtype22\",\"vendor\":\"\",\"allotment_start_Time\":\"\",\"allotment_end_time\":\"\",\"superbook_start_time\":\"\",\"superbook_end_time\":\"\",\"roomQuota\":[{\"date\":2010-01-28,\"quota\":10,\"al_quota\":2,\"sp_quota\":3},{\"date\":2010-01-29,\"quota\":10,\"al_quota\":2,\"sp_quota\":3}]}]");
XhotelRoomsUpdateResponse rsp = client.execute(req, sessionKey);
System.out.println(rsp.getBody());
ITopClient client = new DefaultTopClient(url, appkey, secret);
XhotelRoomsUpdateRequest req = new XhotelRoomsUpdateRequest();
req.RoomQuotaMap = "[{\"out_rid\":\"hotel1_roomtype22\",\"vendor\":\"\",\"allotment_start_Time\":\"\",\"allotment_end_time\":\"\",\"superbook_start_time\":\"\",\"superbook_end_time\":\"\",\"roomQuota\":[{\"date\":2010-01-28,\"quota\":10,\"al_quota\":2,\"sp_quota\":3},{\"date\":2010-01-29,\"quota\":10,\"al_quota\":2,\"sp_quota\":3}]}]";
XhotelRoomsUpdateResponse rsp = client.Execute(req, sessionKey);
Console.WriteLine(rsp.Body);
$c = new TopClient;
$c->appkey = $appkey;
$c->secretKey = $secret;
$req = new XhotelRoomsUpdateRequest;
$req->setRoomQuotaMap("[{\"out_rid\":\"hotel1_roomtype22\",\"vendor\":\"\",\"allotment_start_Time\":\"\",\"allotment_end_time\":\"\",\"superbook_start_time\":\"\",\"superbook_end_time\":\"\",\"roomQuota\":[{\"date\":2010-01-28,\"quota\":10,\"al_quota\":2,\"sp_quota\":3},{\"date\":2010-01-29,\"quota\":10,\"al_quota\":2,\"sp_quota\":3}]}]");
$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.rooms.update' \
-d 'partner_id=apidoc' \
-d 'session=f3d43591-5b14-43fc-bf7e-8c424ca96a13' \
-d 'sign=102FF9D8DDA2BB523F347683B0008EA7' \
-d 'sign_method=hmac' \
-d 'timestamp=2024-12-26+19%3A12%3A01' \
-d 'v=2.0' \
-d 'room_quota_map=%7B%22out_rid%22%3A%22hotel1_roomtype22%22%2C%22vendor%22%3A%22%22%2C%22allotment_start_Time%22%3A%22%22%2C%22allotment_end_time%22%3A%22%22%2C%22superbook_start_time%22%3A%22%22%2C%22superbook_end_time%22%3A%22%22%2C%22roomQuota%22%3A%5B%7B%22date%22%3A2010-01-28%2C%22quota%22%3A10%2C%22al_quota%22%3A2%2C%22sp_quota%22%3A3%7D%2C%7B%22date%22%3A2010-01-29%2C%22quota%22%3A10%2C%22al_quota%22%3A2%2C%22sp_quota%22%3A3%7D%5D%7D'
# -*- coding: utf-8 -*-
import top.api
req=top.api.XhotelRoomsUpdateRequest(url,port)
req.set_app_info(top.appinfo(appkey,secret))
req.room_quota_map="[{\"out_rid\":\"hotel1_roomtype22\",\"vendor\":\"\",\"allotment_start_Time\":\"\",\"allotment_end_time\":\"\",\"superbook_start_time\":\"\",\"superbook_end_time\":\"\",\"roomQuota\":[{\"date\":2010-01-28,\"quota\":10,\"al_quota\":2,\"sp_quota\":3},{\"date\":2010-01-29,\"quota\":10,\"al_quota\":2,\"sp_quota\":3}]}]"
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.rooms.update");
add_param(pRequest,"room_quota_map","{"out_rid":"hotel1_roomtype22","vendor":"","allotment_start_Time":"","allotment_end_time":"","superbook_start_time":"","superbook_end_time":"","roomQuota":[{"date":2010-01-28,"quota":10,"al_quota":2,"sp_quota":3},{"date":2010-01-29,"quota":10,"al_quota":2,"sp_quota":3}]}");
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.rooms.update', {
'room_quota_map':'{"out_rid":"hotel1_roomtype22","vendor":"","allotment_start_Time":"","allotment_end_time":"","superbook_start_time":"","superbook_end_time":"","roomQuota":[{"date":2010-01-28,"quota":10,"al_quota":2,"sp_quota":3},{"date":2010-01-29,"quota":10,"al_quota":2,"sp_quota":3}]}'
}, function(error, response) {
if (!error) console.log(response);
else console.log(error);
})