TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
AlitripInsuranceInquiryRequest req = new AlitripInsuranceInquiryRequest();
req.setArrAirport("PEK");
req.setCabin("Y");
req.setPassword("7b1e6dd7e98f6e84f246cb4783880449");
req.setProductType("QW");
req.setFlightNo("CA1305");
req.setAirlineCode("CA");
req.setIgnoredShopNames("xxx,yyy");
req.setReservationCode("143243223");
req.setChannelName("feiye");
req.setDepDate("2015-08-21");
req.setDepAirport("SZX");
req.setTraverNumber(2L);
req.setSalePrice(800L);
AlitripInsuranceInquiryResponse rsp = client.execute(req);
System.out.println(rsp.getBody());
ITopClient client = new DefaultTopClient(url, appkey, secret);
AlitripInsuranceInquiryRequest req = new AlitripInsuranceInquiryRequest();
req.ArrAirport = "PEK";
req.Cabin = "Y";
req.Password = "7b1e6dd7e98f6e84f246cb4783880449";
req.ProductType = "QW";
req.FlightNo = "CA1305";
req.AirlineCode = "CA";
req.IgnoredShopNames = "xxx,yyy";
req.ReservationCode = "143243223";
req.ChannelName = "feiye";
req.DepDate = "2015-08-21";
req.DepAirport = "SZX";
req.TraverNumber = 2L;
req.SalePrice = 800L;
AlitripInsuranceInquiryResponse rsp = client.Execute(req);
Console.WriteLine(rsp.Body);
$c = new TopClient;
$c->appkey = $appkey;
$c->secretKey = $secret;
$req = new AlitripInsuranceInquiryRequest;
$req->setArrAirport("PEK");
$req->setCabin("Y");
$req->setPassword("7b1e6dd7e98f6e84f246cb4783880449");
$req->setProductType("QW");
$req->setFlightNo("CA1305");
$req->setAirlineCode("CA");
$req->setIgnoredShopNames("xxx,yyy");
$req->setReservationCode("143243223");
$req->setChannelName("feiye");
$req->setDepDate("2015-08-21");
$req->setDepAirport("SZX");
$req->setTraverNumber("2");
$req->setSalePrice("800");
$resp = $c->execute($req);
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.alitrip.insurance.inquiry' \
-d 'partner_id=apidoc' \
-d 'sign=DA2C9C40CE1BE18505C2266DF46B87E0' \
-d 'sign_method=hmac' \
-d 'timestamp=2025-01-30+13%3A01%3A53' \
-d 'v=2.0' \
-d 'airline_code=CA' \
-d 'arr_airport=PEK' \
-d 'cabin=Y' \
-d 'channel_name=feiye' \
-d 'dep_airport=SZX' \
-d 'dep_date=2015-08-21' \
-d 'flight_no=CA1305' \
-d 'ignored_shop_names=xxx%2Cyyy' \
-d 'password=7b1e6dd7e98f6e84f246cb4783880449' \
-d 'product_type=QW' \
-d 'reservation_code=143243223' \
-d 'sale_price=800' \
-d 'traver_number=2'
# -*- coding: utf-8 -*-
import top.api
req=top.api.AlitripInsuranceInquiryRequest(url,port)
req.set_app_info(top.appinfo(appkey,secret))
req.arr_airport="PEK"
req.cabin="Y"
req.password="7b1e6dd7e98f6e84f246cb4783880449"
req.product_type="QW"
req.flight_no="CA1305"
req.airline_code="CA"
req.ignored_shop_names="xxx,yyy"
req.reservation_code="143243223"
req.channel_name="feiye"
req.dep_date="2015-08-21"
req.dep_airport="SZX"
req.traver_number=2
req.sale_price=800
try:
resp= req.getResponse()
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.alitrip.insurance.inquiry");
add_param(pRequest,"arr_airport","PEK");
add_param(pRequest,"cabin","Y");
add_param(pRequest,"password","7b1e6dd7e98f6e84f246cb4783880449");
add_param(pRequest,"product_type","QW");
add_param(pRequest,"flight_no","CA1305");
add_param(pRequest,"airline_code","CA");
add_param(pRequest,"ignored_shop_names","xxx,yyy");
add_param(pRequest,"reservation_code","143243223");
add_param(pRequest,"channel_name","feiye");
add_param(pRequest,"dep_date","2015-08-21");
add_param(pRequest,"dep_airport","SZX");
add_param(pRequest,"traver_number","2");
add_param(pRequest,"sale_price","800");
pResponse = top_execute(pClient,pRequest,NULL);
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.alitrip.insurance.inquiry', {
'arr_airport':'PEK',
'cabin':'Y',
'password':'7b1e6dd7e98f6e84f246cb4783880449',
'product_type':'QW',
'flight_no':'CA1305',
'airline_code':'CA',
'ignored_shop_names':'xxx,yyy',
'reservation_code':'143243223',
'channel_name':'feiye',
'dep_date':'2015-08-21',
'dep_airport':'SZX',
'traver_number':'2',
'sale_price':'800'
}, function(error, response) {
if (!error) console.log(response);
else console.log(error);
})