TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
AlitripBtripApprovalNewRequest req = new AlitripBtripApprovalNewRequest();
AlitripBtripApprovalNewRequest.OpenAddApplyRq obj1 = new AlitripBtripApprovalNewRequest.OpenAddApplyRq();
List<AlitripBtripApprovalNewRequest.OpenItineraryInfo> list3 = new ArrayList<AlitripBtripApprovalNewRequest.OpenItineraryInfo>();
AlitripBtripApprovalNewRequest.OpenItineraryInfo obj4 = new AlitripBtripApprovalNewRequest.OpenItineraryInfo();
list3.add(obj4);
obj4.setDepCity("杭州");
obj4.setTrafficType(0L);
obj4.setItineraryId("abc");
obj4.setTripWay(0L);
obj4.setArrDate(StringUtils.parseDateTime("2017-01-01 00:00:00"));
obj4.setDepDate(StringUtils.parseDateTime("2017-01-01 00:00:00"));
obj4.setInvoiceId(123L);
obj4.setCostCenterId(123L);
obj4.setArrCity("北京");
obj4.setDepCityCode("HGH");
obj4.setArrCityCode("BJS");
obj4.setThirdpartCostCenterId("12345");
obj4.setProjectCode("xm1");
obj4.setProjectTitle("项目1");
obj1.setItineraryList(list3);
obj1.setTripTitle("我的出差申请");
obj1.setApplyId("12345");
obj1.setTripDay(2L);
obj1.setDepartName("综合部");
obj1.setCorpName("淘宝");
obj1.setUserId("user123");
obj1.setUserName("张三");
obj1.setDepartId("depart123");
List<AlitripBtripApprovalNewRequest.OpenUserInfo> list6 = new ArrayList<AlitripBtripApprovalNewRequest.OpenUserInfo>();
AlitripBtripApprovalNewRequest.OpenUserInfo obj7 = new AlitripBtripApprovalNewRequest.OpenUserInfo();
list6.add(obj7);
obj7.setUserName("张三");
obj7.setUserId("user123");
obj1.setTravelerList(list6);
obj1.setTripCause("项目交接");
obj1.setCorpId("corp123");
obj1.setStatus(0L);
obj1.setApplyShowId("12345");
req.setAddApplyRequest(obj1);
AlitripBtripApprovalNewResponse rsp = client.execute(req, sessionKey);
System.out.println(rsp.getBody());
ITopClient client = new DefaultTopClient(url, appkey, secret);
AlitripBtripApprovalNewRequest req = new AlitripBtripApprovalNewRequest();
AlitripBtripApprovalNewRequest.OpenAddApplyRqDomain obj1 = new AlitripBtripApprovalNewRequest.OpenAddApplyRqDomain();
List<AlitripBtripApprovalNewRequest.OpenItineraryInfoDomain> list3 = new List<AlitripBtripApprovalNewRequest.OpenItineraryInfoDomain>();
AlitripBtripApprovalNewRequest.OpenItineraryInfoDomain obj4 = new AlitripBtripApprovalNewRequest.OpenItineraryInfoDomain();
list3.Add(obj4);
obj4.DepCity = "杭州";
obj4.TrafficType = 0L;
obj4.ItineraryId = "abc";
obj4.TripWay = 0L;
obj4.ArrDate = DateTime.Parse(2017-01-01 00:00:00");
obj4.DepDate = DateTime.Parse(2017-01-01 00:00:00");
obj4.InvoiceId = 123L;
obj4.CostCenterId = 123L;
obj4.ArrCity = "北京";
obj4.DepCityCode = "HGH";
obj4.ArrCityCode = "BJS";
obj4.ThirdpartCostCenterId = "12345";
obj4.ProjectCode = "xm1";
obj4.ProjectTitle = "项目1";
obj1.ItineraryList= list3;
obj1.TripTitle = "我的出差申请";
obj1.ApplyId = "12345";
obj1.TripDay = 2L;
obj1.DepartName = "综合部";
obj1.CorpName = "淘宝";
obj1.UserId = "user123";
obj1.UserName = "张三";
obj1.DepartId = "depart123";
List<AlitripBtripApprovalNewRequest.OpenUserInfoDomain> list6 = new List<AlitripBtripApprovalNewRequest.OpenUserInfoDomain>();
AlitripBtripApprovalNewRequest.OpenUserInfoDomain obj7 = new AlitripBtripApprovalNewRequest.OpenUserInfoDomain();
list6.Add(obj7);
obj7.UserName = "张三";
obj7.UserId = "user123";
obj1.TravelerList= list6;
obj1.TripCause = "项目交接";
obj1.CorpId = "corp123";
obj1.Status = 0L;
obj1.ApplyShowId = "12345";
req.AddApplyRequest_ = obj1;
AlitripBtripApprovalNewResponse rsp = client.Execute(req, sessionKey);
Console.WriteLine(rsp.Body);
$c = new TopClient;
$c->appkey = $appkey;
$c->secretKey = $secret;
$req = new AlitripBtripApprovalNewRequest;
$add_apply_request = new OpenAddApplyRq;
$itinerary_list = new OpenItineraryInfo;
$itinerary_list->dep_city="杭州";
$itinerary_list->traffic_type="0";
$itinerary_list->itinerary_id="abc";
$itinerary_list->trip_way="0";
$itinerary_list->arr_date="2017-01-01 00:00:00";
$itinerary_list->dep_date="2017-01-01 00:00:00";
$itinerary_list->invoice_id="123";
$itinerary_list->cost_center_id="123";
$itinerary_list->arr_city="北京";
$itinerary_list->dep_city_code="HGH";
$itinerary_list->arr_city_code="BJS";
$itinerary_list->thirdpart_cost_center_id="12345";
$itinerary_list->project_code="xm1";
$itinerary_list->project_title="项目1";
$add_apply_request->itinerary_list = $itinerary_list;
$add_apply_request->trip_title="我的出差申请";
$add_apply_request->apply_id="12345";
$add_apply_request->trip_day="2";
$add_apply_request->depart_name="综合部";
$add_apply_request->corp_name="淘宝";
$add_apply_request->user_id="user123";
$add_apply_request->user_name="张三";
$add_apply_request->depart_id="depart123";
$traveler_list = new OpenUserInfo;
$traveler_list->user_name="张三";
$traveler_list->user_id="user123";
$add_apply_request->traveler_list = $traveler_list;
$add_apply_request->trip_cause="项目交接";
$add_apply_request->corp_id="corp123";
$add_apply_request->status="0";
$add_apply_request->apply_show_id="12345";
$req->setAddApplyRequest(json_encode($add_apply_request));
$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.approval.new' \
-d 'partner_id=apidoc' \
-d 'session=dab4ddf5-ff40-46d0-b027-9f7ed49a7155' \
-d 'sign=CDCEC593E99E347CF711AA8DF8AE45E7' \
-d 'sign_method=hmac' \
-d 'timestamp=2024-11-21+19%3A49%3A25' \
-d 'v=2.0' \
-d 'add_apply_request=null'
# -*- coding: utf-8 -*-
import top.api
req=top.api.AlitripBtripApprovalNewRequest(url,port)
req.set_app_info(top.appinfo(appkey,secret))
req.add_apply_request=""
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.approval.new");
add_param(pRequest,"add_apply_request","数据结构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.approval.new', {
'add_apply_request':'数据结构JSON示例'
}, function(error, response) {
if (!error) console.log(response);
else console.log(error);
})