TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
XhotelCmOtaHotelrateamountnotifPostRequest req = new XhotelCmOtaHotelrateamountnotifPostRequest();
XhotelCmOtaHotelrateamountnotifPostRequest.OpenApi4CMRequest obj1 = new XhotelCmOtaHotelrateamountnotifPostRequest.OpenApi4CMRequest();
XhotelCmOtaHotelrateamountnotifPostRequest.Head obj2 = new XhotelCmOtaHotelrateamountnotifPostRequest.Head();
obj2.setVendorKey("fliggy");
obj2.setVendorCode("teqwyuiriwer==");
obj1.setHead(obj2);
obj1.setBody("<OTA_HotelRateAmountNotifRQ Version=\"1.0\" EchoToken=\"traceID\" PrimaryLangID=\"en-us\" TimeStamp=\"2021-10-10T09:30:47Z\" xmlns=\"http://www.opentravel.org/OTA/2003/05\"> <RateAmountMessages HotelCode=\"54394\"> <RateAmountMessage> <StatusApplicationControl InvTypeCode=\"10589645\" RatePlanCode=\"1894567\"/> <Rates> <Rate Start=\"2021-10-19\" End=\"2021-11-20\"> <BaseByGuestAmts> <BaseByGuestAmt AgeQualifyingCode=\"10\" AmountAfterTax=\"100.00\" CurrencyCode=\"EUR\" NumberOfGuests=\"1\"/> <BaseByGuestAmt AgeQualifyingCode=\"10\" AmountAfterTax=\"200.00\" CurrencyCode=\"EUR\" NumberOfGuests=\"2\"/> <BaseByGuestAmt AgeQualifyingCode=\"10\" AmountAfterTax=\"300.00\" CurrencyCode=\"EUR\" NumberOfGuests=\"3\"/> <BaseByGuestAmt AgeQualifyingCode=\"10\" AmountAfterTax=\"400.00\" CurrencyCode=\"EUR\" NumberOfGuests=\"4\"/> </BaseByGuestAmts> </Rate> </Rates> </RateAmountMessage> </RateAmountMessages> </OTA_HotelRateAmountNotifRQ>");
req.setOtaRequest(obj1);
XhotelCmOtaHotelrateamountnotifPostResponse rsp = client.execute(req, sessionKey);
System.out.println(rsp.getBody());
ITopClient client = new DefaultTopClient(url, appkey, secret);
XhotelCmOtaHotelrateamountnotifPostRequest req = new XhotelCmOtaHotelrateamountnotifPostRequest();
XhotelCmOtaHotelrateamountnotifPostRequest.OpenApi4CMRequestDomain obj1 = new XhotelCmOtaHotelrateamountnotifPostRequest.OpenApi4CMRequestDomain();
XhotelCmOtaHotelrateamountnotifPostRequest.HeadDomain obj2 = new XhotelCmOtaHotelrateamountnotifPostRequest.HeadDomain();
obj2.VendorKey = "fliggy";
obj2.VendorCode = "teqwyuiriwer==";
obj1.Head= obj2;
obj1.Body = "<OTA_HotelRateAmountNotifRQ Version=\"1.0\" EchoToken=\"traceID\" PrimaryLangID=\"en-us\" TimeStamp=\"2021-10-10T09:30:47Z\" xmlns=\"http://www.opentravel.org/OTA/2003/05\"> <RateAmountMessages HotelCode=\"54394\"> <RateAmountMessage> <StatusApplicationControl InvTypeCode=\"10589645\" RatePlanCode=\"1894567\"/> <Rates> <Rate Start=\"2021-10-19\" End=\"2021-11-20\"> <BaseByGuestAmts> <BaseByGuestAmt AgeQualifyingCode=\"10\" AmountAfterTax=\"100.00\" CurrencyCode=\"EUR\" NumberOfGuests=\"1\"/> <BaseByGuestAmt AgeQualifyingCode=\"10\" AmountAfterTax=\"200.00\" CurrencyCode=\"EUR\" NumberOfGuests=\"2\"/> <BaseByGuestAmt AgeQualifyingCode=\"10\" AmountAfterTax=\"300.00\" CurrencyCode=\"EUR\" NumberOfGuests=\"3\"/> <BaseByGuestAmt AgeQualifyingCode=\"10\" AmountAfterTax=\"400.00\" CurrencyCode=\"EUR\" NumberOfGuests=\"4\"/> </BaseByGuestAmts> </Rate> </Rates> </RateAmountMessage> </RateAmountMessages> </OTA_HotelRateAmountNotifRQ>";
req.OtaRequest_ = obj1;
XhotelCmOtaHotelrateamountnotifPostResponse rsp = client.Execute(req, sessionKey);
Console.WriteLine(rsp.Body);
$c = new TopClient;
$c->appkey = $appkey;
$c->secretKey = $secret;
$req = new XhotelCmOtaHotelrateamountnotifPostRequest;
$ota_request = new OpenApi4CMRequest;
$head = new Head;
$head->vendor_key="fliggy";
$head->vendor_code="teqwyuiriwer==";
$ota_request->head = $head;
$ota_request->body="<OTA_HotelRateAmountNotifRQ Version=\"1.0\" EchoToken=\"traceID\" PrimaryLangID=\"en-us\" TimeStamp=\"2021-10-10T09:30:47Z\" xmlns=\"http://www.opentravel.org/OTA/2003/05\"> <RateAmountMessages HotelCode=\"54394\"> <RateAmountMessage> <StatusApplicationControl InvTypeCode=\"10589645\" RatePlanCode=\"1894567\"/> <Rates> <Rate Start=\"2021-10-19\" End=\"2021-11-20\"> <BaseByGuestAmts> <BaseByGuestAmt AgeQualifyingCode=\"10\" AmountAfterTax=\"100.00\" CurrencyCode=\"EUR\" NumberOfGuests=\"1\"/> <BaseByGuestAmt AgeQualifyingCode=\"10\" AmountAfterTax=\"200.00\" CurrencyCode=\"EUR\" NumberOfGuests=\"2\"/> <BaseByGuestAmt AgeQualifyingCode=\"10\" AmountAfterTax=\"300.00\" CurrencyCode=\"EUR\" NumberOfGuests=\"3\"/> <BaseByGuestAmt AgeQualifyingCode=\"10\" AmountAfterTax=\"400.00\" CurrencyCode=\"EUR\" NumberOfGuests=\"4\"/> </BaseByGuestAmts> </Rate> </Rates> </RateAmountMessage> </RateAmountMessages> </OTA_HotelRateAmountNotifRQ>";
$req->setOtaRequest(json_encode($ota_request));
$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.cm.ota.hotelrateamountnotif.post' \
-d 'partner_id=apidoc' \
-d 'session=3176fc44-c66b-4536-8fd0-1f1fdf6c51ca' \
-d 'sign=8B9BAC30AE3AE9708599E8AAAAE8E112' \
-d 'sign_method=hmac' \
-d 'timestamp=2026-06-07+10%3A28%3A10' \
-d 'v=2.0' \
-d 'ota_request=null'
# -*- coding: utf-8 -*-
import top.api
req=top.api.XhotelCmOtaHotelrateamountnotifPostRequest(url,port)
req.set_app_info(top.appinfo(appkey,secret))
req.ota_request="数据结构示例JSON格式"
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.cm.ota.hotelrateamountnotif.post");
add_param(pRequest,"ota_request","数据结构JSON示例");
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',
'url': 'http://gw.api.taobao.com/router/rest'
});
client.execute('taobao.xhotel.cm.ota.hotelrateamountnotif.post', {
'ota_request':'数据结构JSON示例'
}, function(error, response) {
if (!error) console.log(response);
else console.log(error);
})