TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
AlitripBtripFlightDistributionRefundNewprecalRequest req = new AlitripBtripFlightDistributionRefundNewprecalRequest();
AlitripBtripFlightDistributionRefundNewprecalRequest.BtripFlightRefundPreCalRq obj1 = new AlitripBtripFlightDistributionRefundNewprecalRequest.BtripFlightRefundPreCalRq();
obj1.setIsVoluntary(1L);
obj1.setDisOrderId("51724621");
List<AlitripBtripFlightDistributionRefundNewprecalRequest.PassengerSegmentInfo> list3 = new ArrayList<AlitripBtripFlightDistributionRefundNewprecalRequest.PassengerSegmentInfo>();
AlitripBtripFlightDistributionRefundNewprecalRequest.PassengerSegmentInfo obj4 = new AlitripBtripFlightDistributionRefundNewprecalRequest.PassengerSegmentInfo();
list3.add(obj4);
obj4.setFlightNo("MU8471");
obj4.setPassengerName("张三");
obj4.setUserId("351761");
obj1.setPassengerSegmentInfoList(list3);
obj1.setSubChannel("jianhang001");
req.setParamBtripFlightRefundPreCalRq(obj1);
AlitripBtripFlightDistributionRefundNewprecalResponse rsp = client.execute(req, sessionKey);
System.out.println(rsp.getBody());
ITopClient client = new DefaultTopClient(url, appkey, secret);
AlitripBtripFlightDistributionRefundNewprecalRequest req = new AlitripBtripFlightDistributionRefundNewprecalRequest();
AlitripBtripFlightDistributionRefundNewprecalRequest.BtripFlightRefundPreCalRqDomain obj1 = new AlitripBtripFlightDistributionRefundNewprecalRequest.BtripFlightRefundPreCalRqDomain();
obj1.IsVoluntary = 1L;
obj1.DisOrderId = "51724621";
List<AlitripBtripFlightDistributionRefundNewprecalRequest.PassengerSegmentInfoDomain> list3 = new List<AlitripBtripFlightDistributionRefundNewprecalRequest.PassengerSegmentInfoDomain>();
AlitripBtripFlightDistributionRefundNewprecalRequest.PassengerSegmentInfoDomain obj4 = new AlitripBtripFlightDistributionRefundNewprecalRequest.PassengerSegmentInfoDomain();
list3.Add(obj4);
obj4.FlightNo = "MU8471";
obj4.PassengerName = "张三";
obj4.UserId = "351761";
obj1.PassengerSegmentInfoList= list3;
obj1.SubChannel = "jianhang001";
req.ParamBtripFlightRefundPreCalRq_ = obj1;
AlitripBtripFlightDistributionRefundNewprecalResponse rsp = client.Execute(req, sessionKey);
Console.WriteLine(rsp.Body);
$c = new TopClient;
$c->appkey = $appkey;
$c->secretKey = $secret;
$req = new AlitripBtripFlightDistributionRefundNewprecalRequest;
$param_btrip_flight_refund_pre_cal_rq = new BtripFlightRefundPreCalRq;
$param_btrip_flight_refund_pre_cal_rq->is_voluntary="1";
$param_btrip_flight_refund_pre_cal_rq->dis_order_id="51724621";
$passenger_segment_info_list = new PassengerSegmentInfo;
$passenger_segment_info_list->flight_no="MU8471";
$passenger_segment_info_list->passenger_name="张三";
$passenger_segment_info_list->user_id="351761";
$param_btrip_flight_refund_pre_cal_rq->passenger_segment_info_list = $passenger_segment_info_list;
$param_btrip_flight_refund_pre_cal_rq->sub_channel="jianhang001";
$req->setParamBtripFlightRefundPreCalRq(json_encode($param_btrip_flight_refund_pre_cal_rq));
$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=alitrip.btrip.flight.distribution.refund.newprecal' \
-d 'partner_id=apidoc' \
-d 'session=2112d763-66a0-40c7-98a4-bee3ed410b58' \
-d 'sign=14E9840C594962F8866C37A2457E5674' \
-d 'sign_method=hmac' \
-d 'timestamp=2024-11-21+19%3A32%3A28' \
-d 'v=2.0' \
-d 'param_btrip_flight_refund_pre_cal_rq=null'
# -*- coding: utf-8 -*-
import top.api
req=top.api.AlitripBtripFlightDistributionRefundNewprecalRequest(url,port)
req.set_app_info(top.appinfo(appkey,secret))
req.param_btrip_flight_refund_pre_cal_rq="数据结构示例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,"alitrip.btrip.flight.distribution.refund.newprecal");
add_param(pRequest,"param_btrip_flight_refund_pre_cal_rq","数据结构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',
'REST_URL': 'http://gw.api.taobao.com/router/rest'
});
client.execute('alitrip.btrip.flight.distribution.refund.newprecal', {
'param_btrip_flight_refund_pre_cal_rq':'数据结构JSON示例'
}, function(error, response) {
if (!error) console.log(response);
else console.log(error);
})