TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
XhotelXitemQueryRequest req = new XhotelXitemQueryRequest();
req.setVendor("taobao");
req.setOutHid("haohua123");
req.setOutRid("room_123");
req.setRatePlanCode("rp_1234");
req.setOutXCodes("[\"abc_123\"]");
XhotelXitemQueryResponse rsp = client.execute(req, sessionKey);
System.out.println(rsp.getBody());
ITopClient client = new DefaultTopClient(url, appkey, secret);
XhotelXitemQueryRequest req = new XhotelXitemQueryRequest();
req.Vendor = "taobao";
req.OutHid = "haohua123";
req.OutRid = "room_123";
req.RatePlanCode = "rp_1234";
req.OutXCodes = "[\"abc_123\"]";
XhotelXitemQueryResponse rsp = client.Execute(req, sessionKey);
Console.WriteLine(rsp.Body);
$c = new TopClient;
$c->appkey = $appkey;
$c->secretKey = $secret;
$req = new XhotelXitemQueryRequest;
$req->setVendor("taobao");
$req->setOutHid("haohua123");
$req->setOutRid("room_123");
$req->setRatePlanCode("rp_1234");
$req->setOutXCodes("[\"abc_123\"]");
$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.xitem.query' \
-d 'partner_id=apidoc' \
-d 'session=e03a4d0b-b870-47c0-a555-99c0532dc422' \
-d 'sign=F1F1A518CF0F998A659A8923DBA56E6F' \
-d 'sign_method=hmac' \
-d 'timestamp=2024-11-21+20%3A44%3A51' \
-d 'v=2.0' \
-d 'out_hid=haohua123' \
-d 'out_rid=room_123' \
-d 'out_x_codes=%22abc_123%22' \
-d 'rate_plan_code=rp_1234' \
-d 'vendor=taobao'
# -*- coding: utf-8 -*-
import top.api
req=top.api.XhotelXitemQueryRequest(url,port)
req.set_app_info(top.appinfo(appkey,secret))
req.vendor="taobao"
req.out_hid="haohua123"
req.out_rid="room_123"
req.rate_plan_code="rp_1234"
req.out_x_codes="[\"abc_123\"]"
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.xitem.query");
add_param(pRequest,"vendor","taobao");
add_param(pRequest,"out_hid","haohua123");
add_param(pRequest,"out_rid","room_123");
add_param(pRequest,"rate_plan_code","rp_1234");
add_param(pRequest,"out_x_codes",""abc_123"");
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.xitem.query', {
'vendor':'taobao',
'out_hid':'haohua123',
'out_rid':'room_123',
'rate_plan_code':'rp_1234',
'out_x_codes':'"abc_123"'
}, function(error, response) {
if (!error) console.log(response);
else console.log(error);
})