TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
AlitripBtripCorpopApplyAddRequest req = new AlitripBtripCorpopApplyAddRequest();
AlitripBtripCorpopApplyAddRequest.OpenApiApplyRq obj1 = new AlitripBtripCorpopApplyAddRequest.OpenApiApplyRq();
obj1.setThirdpartApplyId("12345");
obj1.setThirdpartBusinessId("12345");
obj1.setCorpId("corp1");
obj1.setCorpName("阿里巴巴");
obj1.setDepartId("dept1");
obj1.setDepartName("淘宝");
List<AlitripBtripCorpopApplyAddRequest.OpenItineraryInfo> list3 = new ArrayList<AlitripBtripCorpopApplyAddRequest.OpenItineraryInfo>();
AlitripBtripCorpopApplyAddRequest.OpenItineraryInfo obj4 = new AlitripBtripCorpopApplyAddRequest.OpenItineraryInfo();
list3.add(obj4);
obj4.setArrCity("北京");
obj4.setArrCityCode("BJS");
obj4.setArrDate(StringUtils.parseDateTime("2017-01-01 00:00:00"));
obj4.setCostCenterId(123L);
obj4.setDepCity("杭州");
obj4.setDepCityCode("HGH");
obj4.setDepDate(StringUtils.parseDateTime("2017-01-01 00:00:00"));
obj4.setInvoiceId(1234L);
obj4.setItineraryId("123456");
obj4.setProjectCode("xm1");
obj4.setProjectTitle("项目1");
obj4.setThirdpartCostCenterId("12345");
obj4.setTrafficType(0L);
obj4.setTripWay(0L);
obj4.setThirdPartInvoiceId("1234");
obj4.setNeedHotel(true);
obj4.setNeedTraffic(true);
obj1.setItineraryList(list3);
obj1.setStatus(0L);
List<AlitripBtripCorpopApplyAddRequest.OpenUserInfo> list6 = new ArrayList<AlitripBtripCorpopApplyAddRequest.OpenUserInfo>();
AlitripBtripCorpopApplyAddRequest.OpenUserInfo obj7 = new AlitripBtripCorpopApplyAddRequest.OpenUserInfo();
list6.add(obj7);
obj7.setUserId("user1");
obj7.setUserName("用户");
obj1.setTravelerList(list6);
obj1.setTripCause("北京出差");
obj1.setTripDay(1L);
obj1.setTripTitle("北京出差");
obj1.setUserId("user1");
obj1.setUserName("张三");
obj1.setVersion(2L);
obj1.setType(2L);
obj1.setUnionNo("tste1");
List<AlitripBtripCorpopApplyAddRequest.OpenUserInfo> list9 = new ArrayList<AlitripBtripCorpopApplyAddRequest.OpenUserInfo>();
AlitripBtripCorpopApplyAddRequest.OpenUserInfo obj10 = new AlitripBtripCorpopApplyAddRequest.OpenUserInfo();
list9.add(obj10);
obj10.setUserName("用户");
obj1.setExternalTravelerList(list9);
obj1.setHotelBudget(1000L);
obj1.setFlightBudget(1000L);
obj1.setTrainBudget(1000L);
obj1.setVehicleBudget(1000L);
obj1.setBudget(1000L);
obj1.setBudgetMerge(1L);
obj1.setLimitTraveler(1L);
obj1.setTogetherBookRule(1L);
AlitripBtripCorpopApplyAddRequest.HotelShareInfo obj11 = new AlitripBtripCorpopApplyAddRequest.HotelShareInfo();
obj11.setType("1");
obj11.setParam("70");
obj1.setHotelShare(obj11);
AlitripBtripCorpopApplyAddRequest.ExternalUserStandard obj12 = new AlitripBtripCorpopApplyAddRequest.ExternalUserStandard();
obj12.setFlightCabins("Y");
obj12.setEconomyDiscount(1L);
obj12.setBusinessDiscount(1L);
obj12.setFirstDiscount(1L);
obj12.setTrainSeats("1");
List<AlitripBtripCorpopApplyAddRequest.HotelCityFee> list14 = new ArrayList<AlitripBtripCorpopApplyAddRequest.HotelCityFee>();
AlitripBtripCorpopApplyAddRequest.HotelCityFee obj15 = new AlitripBtripCorpopApplyAddRequest.HotelCityFee();
list14.add(obj15);
obj15.setCityCode("330100");
obj15.setCityName("北京");
obj15.setFee(10000L);
obj12.setHotelCitys(list14);
obj12.setReserveType(1L);
obj12.setInternationalFlightCabins("Y");
obj12.setPremiumEconomyDiscount(1L);
obj1.setExternalTravelerStandard(obj12);
List<AlitripBtripCorpopApplyAddRequest.InternalUserStandard> list17 = new ArrayList<AlitripBtripCorpopApplyAddRequest.InternalUserStandard>();
AlitripBtripCorpopApplyAddRequest.InternalUserStandard obj18 = new AlitripBtripCorpopApplyAddRequest.InternalUserStandard();
list17.add(obj18);
obj18.setFlightCabins("Y");
obj18.setEconomyDiscount(1L);
obj18.setBusinessDiscount(1L);
obj18.setFirstDiscount(1L);
obj18.setTrainSeats("1");
List<AlitripBtripCorpopApplyAddRequest.HotelCityFee> list21 = new ArrayList<AlitripBtripCorpopApplyAddRequest.HotelCityFee>();
AlitripBtripCorpopApplyAddRequest.HotelCityFee obj22 = new AlitripBtripCorpopApplyAddRequest.HotelCityFee();
list21.add(obj22);
obj22.setCityCode("330100");
obj22.setCityName("北京");
obj22.setFee(100000L);
list19.setHotelCitys(list21);
obj18.setReserveType(1L);
obj18.setUserId("weifeng");
obj18.setInternationalFlightCabins("Y");
obj18.setPremiumEconomyDiscount(1L);
obj1.setTravelerStandard(list17);
obj1.setItineraryRule(0L);
List<AlitripBtripCorpopApplyAddRequest.OpenItinerarySetInfo> list24 = new ArrayList<AlitripBtripCorpopApplyAddRequest.OpenItinerarySetInfo>();
AlitripBtripCorpopApplyAddRequest.OpenItinerarySetInfo obj25 = new AlitripBtripCorpopApplyAddRequest.OpenItinerarySetInfo();
list24.add(obj25);
obj25.setItineraryId("sdfgh");
obj25.setTrafficType(0L);
obj25.setCitySet("北京,上海");
obj25.setCityCodeSet("BJS,SHA");
obj25.setDepDate("2017-01-01 00:00:00");
obj25.setArrDate("2017-01-01 00:00:00");
obj25.setCostCenterId(23456L);
obj25.setThirdpartCostCenterId("sdfgh");
obj25.setInvoiceId(123456L);
obj25.setThirdPartInvoiceId("cbjdkschnd");
obj25.setProjectCode("项目编号");
obj25.setProjectTitle("项目名称");
obj1.setItinerarySetList(list24);
obj1.setExtendField("{\"cost_center\":\"成本中心\"}");
req.setRq(obj1);
AlitripBtripCorpopApplyAddResponse rsp = client.execute(req, sessionKey);
System.out.println(rsp.getBody());
ITopClient client = new DefaultTopClient(url, appkey, secret);
AlitripBtripCorpopApplyAddRequest req = new AlitripBtripCorpopApplyAddRequest();
AlitripBtripCorpopApplyAddRequest.OpenApiApplyRqDomain obj1 = new AlitripBtripCorpopApplyAddRequest.OpenApiApplyRqDomain();
obj1.ThirdpartApplyId = "12345";
obj1.ThirdpartBusinessId = "12345";
obj1.CorpId = "corp1";
obj1.CorpName = "阿里巴巴";
obj1.DepartId = "dept1";
obj1.DepartName = "淘宝";
List<AlitripBtripCorpopApplyAddRequest.OpenItineraryInfoDomain> list3 = new List<AlitripBtripCorpopApplyAddRequest.OpenItineraryInfoDomain>();
AlitripBtripCorpopApplyAddRequest.OpenItineraryInfoDomain obj4 = new AlitripBtripCorpopApplyAddRequest.OpenItineraryInfoDomain();
list3.Add(obj4);
obj4.ArrCity = "北京";
obj4.ArrCityCode = "BJS";
obj4.ArrDate = DateTime.Parse(2017-01-01 00:00:00");
obj4.CostCenterId = 123L;
obj4.DepCity = "杭州";
obj4.DepCityCode = "HGH";
obj4.DepDate = DateTime.Parse(2017-01-01 00:00:00");
obj4.InvoiceId = 1234L;
obj4.ItineraryId = "123456";
obj4.ProjectCode = "xm1";
obj4.ProjectTitle = "项目1";
obj4.ThirdpartCostCenterId = "12345";
obj4.TrafficType = 0L;
obj4.TripWay = 0L;
obj4.ThirdPartInvoiceId = "1234";
obj4.NeedHotel = true;
obj4.NeedTraffic = true;
obj1.ItineraryList= list3;
obj1.Status = 0L;
List<AlitripBtripCorpopApplyAddRequest.OpenUserInfoDomain> list6 = new List<AlitripBtripCorpopApplyAddRequest.OpenUserInfoDomain>();
AlitripBtripCorpopApplyAddRequest.OpenUserInfoDomain obj7 = new AlitripBtripCorpopApplyAddRequest.OpenUserInfoDomain();
list6.Add(obj7);
obj7.UserId = "user1";
obj7.UserName = "用户";
obj1.TravelerList= list6;
obj1.TripCause = "北京出差";
obj1.TripDay = 1L;
obj1.TripTitle = "北京出差";
obj1.UserId = "user1";
obj1.UserName = "张三";
obj1.Version = 2L;
obj1.Type = 2L;
obj1.UnionNo = "tste1";
List<AlitripBtripCorpopApplyAddRequest.OpenUserInfoDomain> list9 = new List<AlitripBtripCorpopApplyAddRequest.OpenUserInfoDomain>();
AlitripBtripCorpopApplyAddRequest.OpenUserInfoDomain obj10 = new AlitripBtripCorpopApplyAddRequest.OpenUserInfoDomain();
list9.Add(obj10);
obj10.UserName = "用户";
obj1.ExternalTravelerList= list9;
obj1.HotelBudget = 1000L;
obj1.FlightBudget = 1000L;
obj1.TrainBudget = 1000L;
obj1.VehicleBudget = 1000L;
obj1.Budget = 1000L;
obj1.BudgetMerge = 1L;
obj1.LimitTraveler = 1L;
obj1.TogetherBookRule = 1L;
AlitripBtripCorpopApplyAddRequest.HotelShareInfoDomain obj11 = new AlitripBtripCorpopApplyAddRequest.HotelShareInfoDomain();
obj11.Type = "1";
obj11.Param = "70";
obj1.HotelShare= obj11;
AlitripBtripCorpopApplyAddRequest.ExternalUserStandardDomain obj12 = new AlitripBtripCorpopApplyAddRequest.ExternalUserStandardDomain();
obj12.FlightCabins = "Y";
obj12.EconomyDiscount = 1L;
obj12.BusinessDiscount = 1L;
obj12.FirstDiscount = 1L;
obj12.TrainSeats = "1";
List<AlitripBtripCorpopApplyAddRequest.HotelCityFeeDomain> list14 = new List<AlitripBtripCorpopApplyAddRequest.HotelCityFeeDomain>();
AlitripBtripCorpopApplyAddRequest.HotelCityFeeDomain obj15 = new AlitripBtripCorpopApplyAddRequest.HotelCityFeeDomain();
list14.Add(obj15);
obj15.CityCode = "330100";
obj15.CityName = "北京";
obj15.Fee = 10000L;
obj12.HotelCitys= list14;
obj12.ReserveType = 1L;
obj12.InternationalFlightCabins = "Y";
obj12.PremiumEconomyDiscount = 1L;
obj1.ExternalTravelerStandard= obj12;
List<AlitripBtripCorpopApplyAddRequest.InternalUserStandardDomain> list17 = new List<AlitripBtripCorpopApplyAddRequest.InternalUserStandardDomain>();
AlitripBtripCorpopApplyAddRequest.InternalUserStandardDomain obj18 = new AlitripBtripCorpopApplyAddRequest.InternalUserStandardDomain();
list17.Add(obj18);
obj18.FlightCabins = "Y";
obj18.EconomyDiscount = 1L;
obj18.BusinessDiscount = 1L;
obj18.FirstDiscount = 1L;
obj18.TrainSeats = "1";
List<AlitripBtripCorpopApplyAddRequest.HotelCityFeeDomain> list20 = new List<AlitripBtripCorpopApplyAddRequest.HotelCityFeeDomain>();
AlitripBtripCorpopApplyAddRequest.HotelCityFeeDomain obj21 = new AlitripBtripCorpopApplyAddRequest.HotelCityFeeDomain();
list20.Add(obj21);
obj21.CityCode = "330100";
obj21.CityName = "北京";
obj21.Fee = 100000L;
obj18.HotelCitys= list20;
obj18.ReserveType = 1L;
obj18.UserId = "weifeng";
obj18.InternationalFlightCabins = "Y";
obj18.PremiumEconomyDiscount = 1L;
obj1.TravelerStandard= list17;
obj1.ItineraryRule = 0L;
List<AlitripBtripCorpopApplyAddRequest.OpenItinerarySetInfoDomain> list23 = new List<AlitripBtripCorpopApplyAddRequest.OpenItinerarySetInfoDomain>();
AlitripBtripCorpopApplyAddRequest.OpenItinerarySetInfoDomain obj24 = new AlitripBtripCorpopApplyAddRequest.OpenItinerarySetInfoDomain();
list23.Add(obj24);
obj24.ItineraryId = "sdfgh";
obj24.TrafficType = 0L;
obj24.CitySet = "北京,上海";
obj24.CityCodeSet = "BJS,SHA";
obj24.DepDate = "2017-01-01 00:00:00";
obj24.ArrDate = "2017-01-01 00:00:00";
obj24.CostCenterId = 23456L;
obj24.ThirdpartCostCenterId = "sdfgh";
obj24.InvoiceId = 123456L;
obj24.ThirdPartInvoiceId = "cbjdkschnd";
obj24.ProjectCode = "项目编号";
obj24.ProjectTitle = "项目名称";
obj1.ItinerarySetList= list23;
obj1.ExtendField = "{\"cost_center\":\"成本中心\"}";
req.Rq_ = obj1;
AlitripBtripCorpopApplyAddResponse rsp = client.Execute(req, sessionKey);
Console.WriteLine(rsp.Body);
$c = new TopClient;
$c->appkey = $appkey;
$c->secretKey = $secret;
$req = new AlitripBtripCorpopApplyAddRequest;
$rq = new OpenApiApplyRq;
$rq->thirdpart_apply_id="12345";
$rq->thirdpart_business_id="12345";
$rq->corp_id="corp1";
$rq->corp_name="阿里巴巴";
$rq->depart_id="dept1";
$rq->depart_name="淘宝";
$itinerary_list = new OpenItineraryInfo;
$itinerary_list->arr_city="北京";
$itinerary_list->arr_city_code="BJS";
$itinerary_list->arr_date="2017-01-01 00:00:00";
$itinerary_list->cost_center_id="123";
$itinerary_list->dep_city="杭州";
$itinerary_list->dep_city_code="HGH";
$itinerary_list->dep_date="2017-01-01 00:00:00";
$itinerary_list->invoice_id="1234";
$itinerary_list->itinerary_id="123456";
$itinerary_list->project_code="xm1";
$itinerary_list->project_title="项目1";
$itinerary_list->thirdpart_cost_center_id="12345";
$itinerary_list->traffic_type="0";
$itinerary_list->trip_way="0";
$itinerary_list->third_part_invoice_id="1234";
$itinerary_list->need_hotel="true";
$itinerary_list->need_traffic="true";
$rq->itinerary_list = $itinerary_list;
$rq->status="0";
$traveler_list = new OpenUserInfo;
$traveler_list->user_id="user1";
$traveler_list->user_name="用户";
$rq->traveler_list = $traveler_list;
$rq->trip_cause="北京出差";
$rq->trip_day="1";
$rq->trip_title="北京出差";
$rq->user_id="user1";
$rq->user_name="张三";
$rq->version="2";
$rq->type="2";
$rq->union_no="tste1";
$external_traveler_list = new OpenUserInfo;
$external_traveler_list->user_name="用户";
$rq->external_traveler_list = $external_traveler_list;
$rq->hotel_budget="1000";
$rq->flight_budget="1000";
$rq->train_budget="1000";
$rq->vehicle_budget="1000";
$rq->budget="1000";
$rq->budget_merge="1";
$rq->limit_traveler="1";
$rq->together_book_rule="1";
$hotel_share = new HotelShareInfo;
$hotel_share->type="1";
$hotel_share->param="70";
$rq->hotel_share = $hotel_share;
$external_traveler_standard = new ExternalUserStandard;
$external_traveler_standard->flight_cabins="Y";
$external_traveler_standard->economy_discount="1";
$external_traveler_standard->business_discount="1";
$external_traveler_standard->first_discount="1";
$external_traveler_standard->train_seats="1";
$hotel_citys = new HotelCityFee;
$hotel_citys->city_code="330100";
$hotel_citys->city_name="北京";
$hotel_citys->fee="10000";
$external_traveler_standard->hotel_citys = $hotel_citys;
$external_traveler_standard->reserve_type="1";
$external_traveler_standard->international_flight_cabins="Y";
$external_traveler_standard->premium_economy_discount="1";
$rq->external_traveler_standard = $external_traveler_standard;
$traveler_standard = new InternalUserStandard;
$traveler_standard->flight_cabins="Y";
$traveler_standard->economy_discount="1";
$traveler_standard->business_discount="1";
$traveler_standard->first_discount="1";
$traveler_standard->train_seats="1";
$hotel_citys = new HotelCityFee;
$hotel_citys->city_code="330100";
$hotel_citys->city_name="北京";
$hotel_citys->fee="100000";
$traveler_standard->hotel_citys = $hotel_citys;
$traveler_standard->reserve_type="1";
$traveler_standard->user_id="weifeng";
$traveler_standard->international_flight_cabins="Y";
$traveler_standard->premium_economy_discount="1";
$rq->traveler_standard = $traveler_standard;
$rq->itinerary_rule="0";
$itinerary_set_list = new OpenItinerarySetInfo;
$itinerary_set_list->itinerary_id="sdfgh";
$itinerary_set_list->traffic_type="0";
$itinerary_set_list->city_set="北京,上海";
$itinerary_set_list->city_code_set="BJS,SHA";
$itinerary_set_list->dep_date="2017-01-01 00:00:00";
$itinerary_set_list->arr_date="2017-01-01 00:00:00";
$itinerary_set_list->cost_center_id="23456";
$itinerary_set_list->thirdpart_cost_center_id="sdfgh";
$itinerary_set_list->invoice_id="123456";
$itinerary_set_list->third_part_invoice_id="cbjdkschnd";
$itinerary_set_list->project_code="项目编号";
$itinerary_set_list->project_title="项目名称";
$rq->itinerary_set_list = $itinerary_set_list;
$rq->extend_field="{\"cost_center\":\"成本中心\"}";
$req->setRq(json_encode($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.corpop.apply.add' \
-d 'partner_id=apidoc' \
-d 'session=ace6cd0d-973a-4649-8151-11f88d665963' \
-d 'sign=7A431D08315ED6D1778617D136ADBB95' \
-d 'sign_method=hmac' \
-d 'timestamp=2024-11-21+20%3A16%3A09' \
-d 'v=2.0' \
-d 'rq=null'
# -*- coding: utf-8 -*-
import top.api
req=top.api.AlitripBtripCorpopApplyAddRequest(url,port)
req.set_app_info(top.appinfo(appkey,secret))
req.rq=""
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.corpop.apply.add");
add_param(pRequest,"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.corpop.apply.add', {
'rq':'数据结构JSON示例'
}, function(error, response) {
if (!error) console.log(response);
else console.log(error);
})