TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
XhotelRoomsIncrementRequest req = new XhotelRoomsIncrementRequest();
req.setRoomQuotaMap("[{\"out_rid\":\"hotel1_roomtype1\",\"vendor\":\"\",\"allotment_start_Time\":\"\",\"allotment_end_time\":\"\",\"superbook_start_time\":\"\",\"superbook_end_time\":\"\",\"roomQuota\":[{\"date\":\"2023-12-28\",\"quota\":10,\"al_quota\":2,\"sp_quota\":3}]},{\"out_rid\":\"hotel1_roomtype2\",\"vendor\":\"\",\"allotment_start_Time\":\"\",\"allotment_end_time\":\"\",\"superbook_start_time\":\"\",\"superbook_end_time\":\"\",\"roomQuota\":[{\"date\":\"2023-12-28\",\"quota\":10,\"al_quota\":2,\"sp_quota\":3}]}]");
XhotelRoomsIncrementResponse rsp = client.execute(req, sessionKey);
System.out.println(rsp.getBody());
ITopClient client = new DefaultTopClient(url, appkey, secret);
XhotelRoomsIncrementRequest req = new XhotelRoomsIncrementRequest();
req.RoomQuotaMap = "[{\"out_rid\":\"hotel1_roomtype1\",\"vendor\":\"\",\"allotment_start_Time\":\"\",\"allotment_end_time\":\"\",\"superbook_start_time\":\"\",\"superbook_end_time\":\"\",\"roomQuota\":[{\"date\":\"2023-12-28\",\"quota\":10,\"al_quota\":2,\"sp_quota\":3}]},{\"out_rid\":\"hotel1_roomtype2\",\"vendor\":\"\",\"allotment_start_Time\":\"\",\"allotment_end_time\":\"\",\"superbook_start_time\":\"\",\"superbook_end_time\":\"\",\"roomQuota\":[{\"date\":\"2023-12-28\",\"quota\":10,\"al_quota\":2,\"sp_quota\":3}]}]";
XhotelRoomsIncrementResponse rsp = client.Execute(req, sessionKey);
Console.WriteLine(rsp.Body);
$c = new TopClient;
$c->appkey = $appkey;
$c->secretKey = $secret;
$req = new XhotelRoomsIncrementRequest;
$req->setRoomQuotaMap("[{\"out_rid\":\"hotel1_roomtype1\",\"vendor\":\"\",\"allotment_start_Time\":\"\",\"allotment_end_time\":\"\",\"superbook_start_time\":\"\",\"superbook_end_time\":\"\",\"roomQuota\":[{\"date\":\"2023-12-28\",\"quota\":10,\"al_quota\":2,\"sp_quota\":3}]},{\"out_rid\":\"hotel1_roomtype2\",\"vendor\":\"\",\"allotment_start_Time\":\"\",\"allotment_end_time\":\"\",\"superbook_start_time\":\"\",\"superbook_end_time\":\"\",\"roomQuota\":[{\"date\":\"2023-12-28\",\"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.increment' \
-d 'partner_id=apidoc' \
-d 'session=2236e45b-e9ff-4dcb-976f-ceced3d2a270' \
-d 'sign=B27DDE26A45ECB54681E111A477ED0A6' \
-d 'sign_method=hmac' \
-d 'timestamp=2024-11-23+16%3A26%3A09' \
-d 'v=2.0' \
-d 'room_quota_map=%7B%22out_rid%22%3A%22hotel1_roomtype1%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%3A%222023-12-28%22%2C%22quota%22%3A10%2C%22al_quota%22%3A2%2C%22sp_quota%22%3A3%7D%5D%7D%2C%7B%22out_rid%22%3A%22hotel1_roomtype2%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%3A%222023-12-28%22%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.XhotelRoomsIncrementRequest(url,port)
req.set_app_info(top.appinfo(appkey,secret))
req.room_quota_map="[{\"out_rid\":\"hotel1_roomtype1\",\"vendor\":\"\",\"allotment_start_Time\":\"\",\"allotment_end_time\":\"\",\"superbook_start_time\":\"\",\"superbook_end_time\":\"\",\"roomQuota\":[{\"date\":\"2023-12-28\",\"quota\":10,\"al_quota\":2,\"sp_quota\":3}]},{\"out_rid\":\"hotel1_roomtype2\",\"vendor\":\"\",\"allotment_start_Time\":\"\",\"allotment_end_time\":\"\",\"superbook_start_time\":\"\",\"superbook_end_time\":\"\",\"roomQuota\":[{\"date\":\"2023-12-28\",\"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.increment");
add_param(pRequest,"room_quota_map","{"out_rid":"hotel1_roomtype1","vendor":"","allotment_start_Time":"","allotment_end_time":"","superbook_start_time":"","superbook_end_time":"","roomQuota":[{"date":"2023-12-28","quota":10,"al_quota":2,"sp_quota":3}]},{"out_rid":"hotel1_roomtype2","vendor":"","allotment_start_Time":"","allotment_end_time":"","superbook_start_time":"","superbook_end_time":"","roomQuota":[{"date":"2023-12-28","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.increment', {
'room_quota_map':'{"out_rid":"hotel1_roomtype1","vendor":"","allotment_start_Time":"","allotment_end_time":"","superbook_start_time":"","superbook_end_time":"","roomQuota":[{"date":"2023-12-28","quota":10,"al_quota":2,"sp_quota":3}]},{"out_rid":"hotel1_roomtype2","vendor":"","allotment_start_Time":"","allotment_end_time":"","superbook_start_time":"","superbook_end_time":"","roomQuota":[{"date":"2023-12-28","quota":10,"al_quota":2,"sp_quota":3}]}'
}, function(error, response) {
if (!error) console.log(response);
else console.log(error);
})