TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
XhotelBnbpromoBindRequest req = new XhotelBnbpromoBindRequest();
req.setActivityCode("111");
XhotelBnbpromoBindRequest.PromoRateInfo obj1 = new XhotelBnbpromoBindRequest.PromoRateInfo();
obj1.setRatePlanCode("111");
obj1.setOutRid("111");
req.setRateInfos(obj1);
req.setCheckInFrom(StringUtils.parseDateTime("2023-05-20 00:00:00"));
req.setCheckOutTo(StringUtils.parseDateTime("2023-05-22 00:00:00"));
XhotelBnbpromoBindResponse rsp = client.execute(req, sessionKey);
System.out.println(rsp.getBody());
ITopClient client = new DefaultTopClient(url, appkey, secret);
XhotelBnbpromoBindRequest req = new XhotelBnbpromoBindRequest();
req.ActivityCode = "111";
XhotelBnbpromoBindRequest.PromoRateInfoDomain obj1 = new XhotelBnbpromoBindRequest.PromoRateInfoDomain();
obj1.RatePlanCode = "111";
obj1.OutRid = "111";
req.RateInfos_ = obj1;
req.CheckInFrom = DateTime.Parse("2023-05-20 00:00:00");
req.CheckOutTo = DateTime.Parse("2023-05-22 00:00:00");
XhotelBnbpromoBindResponse rsp = client.Execute(req, sessionKey);
Console.WriteLine(rsp.Body);
$c = new TopClient;
$c->appkey = $appkey;
$c->secretKey = $secret;
$req = new XhotelBnbpromoBindRequest;
$req->setActivityCode("111");
$rate_infos = new PromoRateInfo;
$rate_infos->rate_plan_code="111";
$rate_infos->out_rid="111";
$req->setRateInfos(json_encode($rate_infos));
$req->setCheckInFrom("2023-05-20 00:00:00");
$req->setCheckOutTo("2023-05-22 00:00:00");
$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.bnbpromo.bind' \
-d 'partner_id=apidoc' \
-d 'session=5719f6e3-f621-4547-a086-7a88df87f0b6' \
-d 'sign=0534B10A6F96D9894A797A650F2FF140' \
-d 'sign_method=hmac' \
-d 'timestamp=2024-11-21+20%3A51%3A23' \
-d 'v=2.0' \
-d 'activity_code=111' \
-d 'check_in_from=2023-05-20+00%3A00%3A00' \
-d 'check_out_to=2023-05-22+00%3A00%3A00' \
-d 'rate_infos=xxx'
# -*- coding: utf-8 -*-
import top.api
req=top.api.XhotelBnbpromoBindRequest(url,port)
req.set_app_info(top.appinfo(appkey,secret))
req.activity_code="111"
req.rate_infos="xxx"
req.check_in_from="2023-05-20 00:00:00"
req.check_out_to="2023-05-22 00:00:00"
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.bnbpromo.bind");
add_param(pRequest,"activity_code","111");
add_param(pRequest,"rate_infos","数据结构JSON示例");
add_param(pRequest,"check_in_from","2023-05-20 00:00:00");
add_param(pRequest,"check_out_to","2023-05-22 00:00:00");
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.bnbpromo.bind', {
'activity_code':'111',
'rate_infos':'数据结构JSON示例',
'check_in_from':'2023-05-20 00:00:00',
'check_out_to':'2023-05-22 00:00:00'
}, function(error, response) {
if (!error) console.log(response);
else console.log(error);
})