TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
AlitripAgentFlightOfferPushRequest req = new AlitripAgentFlightOfferPushRequest();
AlitripAgentFlightOfferPushRequest.IntlOfferPushDTO obj1 = new AlitripAgentFlightOfferPushRequest.IntlOfferPushDTO();
obj1.setAgentId(5580L);
obj1.setToCity("HKG");
obj1.setRetDate("20171230");
obj1.setFromDate("20171224");
obj1.setTripType(1L);
obj1.setAgentDeveloperId("123knjkkjljkl");
obj1.setAgentDeveloperSecret("123ljkjk");
obj1.setFromCity("BJS");
obj1.setChannelId(1074L);
obj1.setSearchRs("{\"status\":0,\"msg\":\"成功.\",\"routings\":[{\"data\":\"1234567890\",\"adultPrice\":1549,\"adultTax\":489,\"childPrice\":1648,\"childTax\":489,\"priceType\":0,\"applyType\":0,\"adultTaxType\":0,\"childTaxType\":0,\"nationalityType\":0,\"nationality\":\"\",\"rule\":{\"hasRefund\":0,\"refund\":\"\",\"hasEndorse\":0,\"endorse\":\"\",\"endorsement\":0,\"hasBaggage\":1,\"baggage\":\"第1,2航段:1件;第3,4航段:1件;\",\"hasNoShow\":1,\"noShowLimitTime\":0,\"specialNoShow\":3,\"other\":\"1.请填写正确乘机信息以及有效的证件信息,一经出票,不能更改证件信息.\"},\"fromSegments\":[{\"carrier\":\"MF\",\"flightNumber\":\"MF8118\",\"depAirport\":\"PEK\",\"depTime\":\"201712241055\",\"arrAirport\":\"XMN\",\"arrTime\":\"201712241400\",\"stopCities\":\"\",\"codeShare\":false,\"cabin\":\"S\",\"aircraftCode\":\"787\",\"cabinClass\":\"Y\",\"seatCount\":4},{\"carrier\":\"MF\",\"flightNumber\":\"MF8015\",\"depAirport\":\"XMN\",\"depTime\":\"201712241825\",\"arrAirport\":\"HKG\",\"arrTime\":\"201712241945\",\"stopCities\":\"\",\"codeShare\":false,\"cabin\":\"S\",\"aircraftCode\":\"738\",\"cabinClass\":\"Y\",\"seatCount\":7}],\"retSegments\":[],\"minPassengerCount\":2,\"maxPassengerCount\":9,\"gvChildRule\":1}]}");
obj1.setCid("12355");
req.setOfferPushDto(obj1);
AlitripAgentFlightOfferPushResponse rsp = client.execute(req, sessionKey);
System.out.println(rsp.getBody());
ITopClient client = new DefaultTopClient(url, appkey, secret);
AlitripAgentFlightOfferPushRequest req = new AlitripAgentFlightOfferPushRequest();
AlitripAgentFlightOfferPushRequest.IntlOfferPushDTODomain obj1 = new AlitripAgentFlightOfferPushRequest.IntlOfferPushDTODomain();
obj1.AgentId = 5580L;
obj1.ToCity = "HKG";
obj1.RetDate = "20171230";
obj1.FromDate = "20171224";
obj1.TripType = 1L;
obj1.AgentDeveloperId = "123knjkkjljkl";
obj1.AgentDeveloperSecret = "123ljkjk";
obj1.FromCity = "BJS";
obj1.ChannelId = 1074L;
obj1.SearchRs = "{\"status\":0,\"msg\":\"成功.\",\"routings\":[{\"data\":\"1234567890\",\"adultPrice\":1549,\"adultTax\":489,\"childPrice\":1648,\"childTax\":489,\"priceType\":0,\"applyType\":0,\"adultTaxType\":0,\"childTaxType\":0,\"nationalityType\":0,\"nationality\":\"\",\"rule\":{\"hasRefund\":0,\"refund\":\"\",\"hasEndorse\":0,\"endorse\":\"\",\"endorsement\":0,\"hasBaggage\":1,\"baggage\":\"第1,2航段:1件;第3,4航段:1件;\",\"hasNoShow\":1,\"noShowLimitTime\":0,\"specialNoShow\":3,\"other\":\"1.请填写正确乘机信息以及有效的证件信息,一经出票,不能更改证件信息.\"},\"fromSegments\":[{\"carrier\":\"MF\",\"flightNumber\":\"MF8118\",\"depAirport\":\"PEK\",\"depTime\":\"201712241055\",\"arrAirport\":\"XMN\",\"arrTime\":\"201712241400\",\"stopCities\":\"\",\"codeShare\":false,\"cabin\":\"S\",\"aircraftCode\":\"787\",\"cabinClass\":\"Y\",\"seatCount\":4},{\"carrier\":\"MF\",\"flightNumber\":\"MF8015\",\"depAirport\":\"XMN\",\"depTime\":\"201712241825\",\"arrAirport\":\"HKG\",\"arrTime\":\"201712241945\",\"stopCities\":\"\",\"codeShare\":false,\"cabin\":\"S\",\"aircraftCode\":\"738\",\"cabinClass\":\"Y\",\"seatCount\":7}],\"retSegments\":[],\"minPassengerCount\":2,\"maxPassengerCount\":9,\"gvChildRule\":1}]}";
obj1.Cid = "12355";
req.OfferPushDto_ = obj1;
AlitripAgentFlightOfferPushResponse rsp = client.Execute(req, sessionKey);
Console.WriteLine(rsp.Body);
$c = new TopClient;
$c->appkey = $appkey;
$c->secretKey = $secret;
$req = new AlitripAgentFlightOfferPushRequest;
$offer_push_dto = new IntlOfferPushDTO;
$offer_push_dto->agent_id="5580";
$offer_push_dto->to_city="HKG";
$offer_push_dto->ret_date="20171230";
$offer_push_dto->from_date="20171224";
$offer_push_dto->trip_type="1";
$offer_push_dto->agent_developer_id="123knjkkjljkl";
$offer_push_dto->agent_developer_secret="123ljkjk";
$offer_push_dto->from_city="BJS";
$offer_push_dto->channel_id="1074";
$offer_push_dto->search_rs="{\"status\":0,\"msg\":\"成功.\",\"routings\":[{\"data\":\"1234567890\",\"adultPrice\":1549,\"adultTax\":489,\"childPrice\":1648,\"childTax\":489,\"priceType\":0,\"applyType\":0,\"adultTaxType\":0,\"childTaxType\":0,\"nationalityType\":0,\"nationality\":\"\",\"rule\":{\"hasRefund\":0,\"refund\":\"\",\"hasEndorse\":0,\"endorse\":\"\",\"endorsement\":0,\"hasBaggage\":1,\"baggage\":\"第1,2航段:1件;第3,4航段:1件;\",\"hasNoShow\":1,\"noShowLimitTime\":0,\"specialNoShow\":3,\"other\":\"1.请填写正确乘机信息以及有效的证件信息,一经出票,不能更改证件信息.\"},\"fromSegments\":[{\"carrier\":\"MF\",\"flightNumber\":\"MF8118\",\"depAirport\":\"PEK\",\"depTime\":\"201712241055\",\"arrAirport\":\"XMN\",\"arrTime\":\"201712241400\",\"stopCities\":\"\",\"codeShare\":false,\"cabin\":\"S\",\"aircraftCode\":\"787\",\"cabinClass\":\"Y\",\"seatCount\":4},{\"carrier\":\"MF\",\"flightNumber\":\"MF8015\",\"depAirport\":\"XMN\",\"depTime\":\"201712241825\",\"arrAirport\":\"HKG\",\"arrTime\":\"201712241945\",\"stopCities\":\"\",\"codeShare\":false,\"cabin\":\"S\",\"aircraftCode\":\"738\",\"cabinClass\":\"Y\",\"seatCount\":7}],\"retSegments\":[],\"minPassengerCount\":2,\"maxPassengerCount\":9,\"gvChildRule\":1}]}";
$offer_push_dto->cid="12355";
$req->setOfferPushDto(json_encode($offer_push_dto));
$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.agent.flight.offer.push' \
-d 'partner_id=apidoc' \
-d 'session=7bba92ea-4d5a-4d13-94dd-4ebda89091b7' \
-d 'sign=94053E0C6BA1525F39EA5321A3336174' \
-d 'sign_method=hmac' \
-d 'timestamp=2025-12-15+07%3A46%3A49' \
-d 'v=2.0' \
-d 'offer_push_dto=null'
# -*- coding: utf-8 -*-
import top.api
req=top.api.AlitripAgentFlightOfferPushRequest(url,port)
req.set_app_info(top.appinfo(appkey,secret))
req.offer_push_dto="数据结构示例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.agent.flight.offer.push");
add_param(pRequest,"offer_push_dto","数据结构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.agent.flight.offer.push', {
'offer_push_dto':'数据结构JSON示例'
}, function(error, response) {
if (!error) console.log(response);
else console.log(error);
})