TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
AlibabaHappytripFlightBeanQueryRequest req = new AlibabaHappytripFlightBeanQueryRequest();
AlibabaHappytripFlightBeanQueryRequest.HtOpenPointFlightRequest obj1 = new AlibabaHappytripFlightBeanQueryRequest.HtOpenPointFlightRequest();
AlibabaHappytripFlightBeanQueryRequest.HtOpenFlightPointSearchMainDTO obj2 = new AlibabaHappytripFlightBeanQueryRequest.HtOpenFlightPointSearchMainDTO();
obj2.setBookDate("2024-08-16");
obj2.setArrOutCode("17");
obj2.setArrCityCode("BJS");
obj2.setDepOutCode("1");
obj2.setArrCity("北京市");
obj2.setDepCity("杭州市");
obj2.setSearchKey("uuiddslgoeqihgfasdhgkjsdlfdsalkvo001");
obj2.setDepCityCode("HGH");
obj1.setSearchMain(obj2);
AlibabaHappytripFlightBeanQueryRequest.HtOpenSearchUserDTO obj3 = new AlibabaHappytripFlightBeanQueryRequest.HtOpenSearchUserDTO();
obj3.setTaHeadId("105286762");
obj3.setLanguage("zh-cn");
obj3.setUserKey("15864575_1");
obj1.setSearchUser(obj3);
List<AlibabaHappytripFlightBeanQueryRequest.HtOpenFlightPointSearchListingDTO> list5 = new ArrayList<AlibabaHappytripFlightBeanQueryRequest.HtOpenFlightPointSearchListingDTO>();
AlibabaHappytripFlightBeanQueryRequest.HtOpenFlightPointSearchListingDTO obj6 = new AlibabaHappytripFlightBeanQueryRequest.HtOpenFlightPointSearchListingDTO();
list5.add(obj6);
obj6.setCabinClass("经济舱");
obj6.setAirlineComName("中国国际航空公司");
obj6.setDepTime("2024-08-16 16:00:00");
obj6.setShortFlightSize("xx");
obj6.setDiscount("88");
obj6.setCabin("Y");
obj6.setFlightType("xx");
obj6.setDepAirport("HGH");
obj6.setFlightNo("CA1719");
obj6.setTransfer(false);
obj6.setStop(false);
obj6.setPrice("2820");
obj6.setAirlineCode("CA");
obj6.setDepAirportName("杭州萧山国际机场");
obj6.setFlightTypeDesc("xx");
obj6.setArrAirport("PEK");
obj6.setArrAirportName("北京首都国际机场");
obj6.setArrTime("2024-08-16 18:45:00");
obj1.setSearchListing(list5);
req.setHtOpenPointFlightRequest(obj1);
AlibabaHappytripFlightBeanQueryResponse rsp = client.execute(req);
System.out.println(rsp.getBody());
ITopClient client = new DefaultTopClient(url, appkey, secret);
AlibabaHappytripFlightBeanQueryRequest req = new AlibabaHappytripFlightBeanQueryRequest();
AlibabaHappytripFlightBeanQueryRequest.HtOpenPointFlightRequestDomain obj1 = new AlibabaHappytripFlightBeanQueryRequest.HtOpenPointFlightRequestDomain();
AlibabaHappytripFlightBeanQueryRequest.HtOpenFlightPointSearchMainDTODomain obj2 = new AlibabaHappytripFlightBeanQueryRequest.HtOpenFlightPointSearchMainDTODomain();
obj2.BookDate = "2024-08-16";
obj2.ArrOutCode = "17";
obj2.ArrCityCode = "BJS";
obj2.DepOutCode = "1";
obj2.ArrCity = "北京市";
obj2.DepCity = "杭州市";
obj2.SearchKey = "uuiddslgoeqihgfasdhgkjsdlfdsalkvo001";
obj2.DepCityCode = "HGH";
obj1.SearchMain= obj2;
AlibabaHappytripFlightBeanQueryRequest.HtOpenSearchUserDTODomain obj3 = new AlibabaHappytripFlightBeanQueryRequest.HtOpenSearchUserDTODomain();
obj3.TaHeadId = "105286762";
obj3.Language = "zh-cn";
obj3.UserKey = "15864575_1";
obj1.SearchUser= obj3;
List<AlibabaHappytripFlightBeanQueryRequest.HtOpenFlightPointSearchListingDTODomain> list5 = new List<AlibabaHappytripFlightBeanQueryRequest.HtOpenFlightPointSearchListingDTODomain>();
AlibabaHappytripFlightBeanQueryRequest.HtOpenFlightPointSearchListingDTODomain obj6 = new AlibabaHappytripFlightBeanQueryRequest.HtOpenFlightPointSearchListingDTODomain();
list5.Add(obj6);
obj6.CabinClass = "经济舱";
obj6.AirlineComName = "中国国际航空公司";
obj6.DepTime = "2024-08-16 16:00:00";
obj6.ShortFlightSize = "xx";
obj6.Discount = "88";
obj6.Cabin = "Y";
obj6.FlightType = "xx";
obj6.DepAirport = "HGH";
obj6.FlightNo = "CA1719";
obj6.Transfer = false;
obj6.Stop = false;
obj6.Price = "2820";
obj6.AirlineCode = "CA";
obj6.DepAirportName = "杭州萧山国际机场";
obj6.FlightTypeDesc = "xx";
obj6.ArrAirport = "PEK";
obj6.ArrAirportName = "北京首都国际机场";
obj6.ArrTime = "2024-08-16 18:45:00";
obj1.SearchListing= list5;
req.HtOpenPointFlightRequest_ = obj1;
AlibabaHappytripFlightBeanQueryResponse rsp = client.Execute(req);
Console.WriteLine(rsp.Body);
$c = new TopClient;
$c->appkey = $appkey;
$c->secretKey = $secret;
$req = new AlibabaHappytripFlightBeanQueryRequest;
$ht_open_point_flight_request = new HtOpenPointFlightRequest;
$search_main = new HtOpenFlightPointSearchMainDTO;
$search_main->book_date="2024-08-16";
$search_main->arr_out_code="17";
$search_main->arr_city_code="BJS";
$search_main->dep_out_code="1";
$search_main->arr_city="北京市";
$search_main->dep_city="杭州市";
$search_main->search_key="uuiddslgoeqihgfasdhgkjsdlfdsalkvo001";
$search_main->dep_city_code="HGH";
$ht_open_point_flight_request->search_main = $search_main;
$search_user = new HtOpenSearchUserDTO;
$search_user->ta_head_id="105286762";
$search_user->language="zh-cn";
$search_user->user_key="15864575_1";
$ht_open_point_flight_request->search_user = $search_user;
$search_listing = new HtOpenFlightPointSearchListingDTO;
$search_listing->cabin_class="经济舱";
$search_listing->airline_com_name="中国国际航空公司";
$search_listing->dep_time="2024-08-16 16:00:00";
$search_listing->short_flight_size="xx";
$search_listing->discount="88";
$search_listing->cabin="Y";
$search_listing->flight_type="xx";
$search_listing->dep_airport="HGH";
$search_listing->flight_no="CA1719";
$search_listing->transfer="false";
$search_listing->stop="false";
$search_listing->price="2820";
$search_listing->airline_code="CA";
$search_listing->dep_airport_name="杭州萧山国际机场";
$search_listing->flight_type_desc="xx";
$search_listing->arr_airport="PEK";
$search_listing->arr_airport_name="北京首都国际机场";
$search_listing->arr_time="2024-08-16 18:45:00";
$ht_open_point_flight_request->search_listing = $search_listing;
$req->setHtOpenPointFlightRequest(json_encode($ht_open_point_flight_request));
$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=alibaba.happytrip.flight.bean.query' \
-d 'partner_id=apidoc' \
-d 'sign=26521F657B00D58DFD58A1E5E25904F2' \
-d 'sign_method=hmac' \
-d 'timestamp=2025-05-02+22%3A49%3A19' \
-d 'v=2.0' \
-d 'ht_open_point_flight_request=null'
# -*- coding: utf-8 -*-
import top.api
req=top.api.AlibabaHappytripFlightBeanQueryRequest(url,port)
req.set_app_info(top.appinfo(appkey,secret))
req.ht_open_point_flight_request="数据结构示例JSON格式"
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,"alibaba.happytrip.flight.bean.query");
add_param(pRequest,"ht_open_point_flight_request","数据结构JSON示例");
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('alibaba.happytrip.flight.bean.query', {
'ht_open_point_flight_request':'数据结构JSON示例'
}, function(error, response) {
if (!error) console.log(response);
else console.log(error);
})