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=9fe55b27-95bb-4041-afbc-d957d9b9fd01' \
-d 'sign=F272F123DCAB607BDC910F648384F18F' \
-d 'sign_method=hmac' \
-d 'timestamp=2024-11-21+20%3A48%3A50' \
-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);
})