TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
XhotelRateGetRequest req = new XhotelRateGetRequest();
req.setGid(100000L);
req.setRpid(100000L);
req.setVendor("ChinaOnline");
req.setRateplanCode("12345AAA");
req.setOutRid("12345AAA");
req.setRateId(112221L);
XhotelRateGetResponse rsp = client.execute(req, sessionKey);
System.out.println(rsp.getBody());
ITopClient client = new DefaultTopClient(url, appkey, secret);
XhotelRateGetRequest req = new XhotelRateGetRequest();
req.Gid = 100000L;
req.Rpid = 100000L;
req.Vendor = "ChinaOnline";
req.RateplanCode = "12345AAA";
req.OutRid = "12345AAA";
req.RateId = 112221L;
XhotelRateGetResponse rsp = client.Execute(req, sessionKey);
Console.WriteLine(rsp.Body);
$c = new TopClient;
$c->appkey = $appkey;
$c->secretKey = $secret;
$req = new XhotelRateGetRequest;
$req->setGid("100000");
$req->setRpid("100000");
$req->setVendor("ChinaOnline");
$req->setRateplanCode("12345AAA");
$req->setOutRid("12345AAA");
$req->setRateId("112221");
$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.rate.get' \
-d 'partner_id=apidoc' \
-d 'session=c4292fca-c19d-4b4f-bb1c-e79df08d4a1e' \
-d 'sign=8FCDA165912614FDF6FC7DF3C2EDD29C' \
-d 'sign_method=hmac' \
-d 'timestamp=2024-12-04+02%3A08%3A11' \
-d 'v=2.0' \
-d 'gid=100000' \
-d 'out_rid=12345AAA' \
-d 'rate_id=112221' \
-d 'rateplan_code=12345AAA' \
-d 'rpid=100000' \
-d 'vendor=ChinaOnline'
# -*- coding: utf-8 -*-
import top.api
req=top.api.XhotelRateGetRequest(url,port)
req.set_app_info(top.appinfo(appkey,secret))
req.gid=100000
req.rpid=100000
req.vendor="ChinaOnline"
req.rateplan_code="12345AAA"
req.out_rid="12345AAA"
req.rate_id=112221
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.rate.get");
add_param(pRequest,"gid","100000");
add_param(pRequest,"rpid","100000");
add_param(pRequest,"vendor","ChinaOnline");
add_param(pRequest,"rateplan_code","12345AAA");
add_param(pRequest,"out_rid","12345AAA");
add_param(pRequest,"rate_id","112221");
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.rate.get', {
'gid':'100000',
'rpid':'100000',
'vendor':'ChinaOnline',
'rateplan_code':'12345AAA',
'out_rid':'12345AAA',
'rate_id':'112221'
}, function(error, response) {
if (!error) console.log(response);
else console.log(error);
})