TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
AlitripBtripApprovalModifyRequest req = new AlitripBtripApprovalModifyRequest();
AlitripBtripApprovalModifyRequest.OpenApiNewApplyRq obj1 = new AlitripBtripApprovalModifyRequest.OpenApiNewApplyRq();
obj1.setTripDay(2L);
obj1.setCorpId("corp123");
obj1.setCorpName("淘宝");
obj1.setUserName("张三");
obj1.setUserId("user123");
obj1.setApplyId("12345");
List<AlitripBtripApprovalModifyRequest.OpenUserInfo> list3 = new ArrayList<AlitripBtripApprovalModifyRequest.OpenUserInfo>();
AlitripBtripApprovalModifyRequest.OpenUserInfo obj4 = new AlitripBtripApprovalModifyRequest.OpenUserInfo();
list3.add(obj4);
obj4.setUserName("张三");
obj4.setUserId("user123");
obj1.setTravelerList(list3);
obj1.setTripTitle("我的出差申请");
obj1.setTripCause("项目交接");
obj1.setDepartId("depart123");
List<AlitripBtripApprovalModifyRequest.OpenItineraryInfo> list6 = new ArrayList<AlitripBtripApprovalModifyRequest.OpenItineraryInfo>();
AlitripBtripApprovalModifyRequest.OpenItineraryInfo obj7 = new AlitripBtripApprovalModifyRequest.OpenItineraryInfo();
list6.add(obj7);
obj7.setDepCity("杭州");
obj7.setTrafficType(0L);
obj7.setItineraryId("abc");
obj7.setTripWay(0L);
obj7.setArrDate(StringUtils.parseDateTime("2017-01-01 00:00:00"));
obj7.setDepDate(StringUtils.parseDateTime("2017-01-01 00:00:00"));
obj7.setInvoiceId(123L);
obj7.setCostCenterId(123L);
obj7.setArrCity("北京");
obj7.setDepCityCode("HGH");
obj7.setArrCityCode("BJS");
obj7.setThirdpartCostCenterId("12345");
obj7.setProjectCode("xm1");
obj7.setProjectTitle("项目1");
obj1.setItineraryList(list6);
obj1.setApplyShowId("12345");
obj1.setDepartName("综合部");
obj1.setStatus(0L);
req.setAddApplyRequest(obj1);
AlitripBtripApprovalModifyResponse rsp = client.execute(req, sessionKey);
System.out.println(rsp.getBody());
ITopClient client = new DefaultTopClient(url, appkey, secret);
AlitripBtripApprovalModifyRequest req = new AlitripBtripApprovalModifyRequest();
AlitripBtripApprovalModifyRequest.OpenApiNewApplyRqDomain obj1 = new AlitripBtripApprovalModifyRequest.OpenApiNewApplyRqDomain();
obj1.TripDay = 2L;
obj1.CorpId = "corp123";
obj1.CorpName = "淘宝";
obj1.UserName = "张三";
obj1.UserId = "user123";
obj1.ApplyId = "12345";
List<AlitripBtripApprovalModifyRequest.OpenUserInfoDomain> list3 = new List<AlitripBtripApprovalModifyRequest.OpenUserInfoDomain>();
AlitripBtripApprovalModifyRequest.OpenUserInfoDomain obj4 = new AlitripBtripApprovalModifyRequest.OpenUserInfoDomain();
list3.Add(obj4);
obj4.UserName = "张三";
obj4.UserId = "user123";
obj1.TravelerList= list3;
obj1.TripTitle = "我的出差申请";
obj1.TripCause = "项目交接";
obj1.DepartId = "depart123";
List<AlitripBtripApprovalModifyRequest.OpenItineraryInfoDomain> list6 = new List<AlitripBtripApprovalModifyRequest.OpenItineraryInfoDomain>();
AlitripBtripApprovalModifyRequest.OpenItineraryInfoDomain obj7 = new AlitripBtripApprovalModifyRequest.OpenItineraryInfoDomain();
list6.Add(obj7);
obj7.DepCity = "杭州";
obj7.TrafficType = 0L;
obj7.ItineraryId = "abc";
obj7.TripWay = 0L;
obj7.ArrDate = DateTime.Parse(2017-01-01 00:00:00");
obj7.DepDate = DateTime.Parse(2017-01-01 00:00:00");
obj7.InvoiceId = 123L;
obj7.CostCenterId = 123L;
obj7.ArrCity = "北京";
obj7.DepCityCode = "HGH";
obj7.ArrCityCode = "BJS";
obj7.ThirdpartCostCenterId = "12345";
obj7.ProjectCode = "xm1";
obj7.ProjectTitle = "项目1";
obj1.ItineraryList= list6;
obj1.ApplyShowId = "12345";
obj1.DepartName = "综合部";
obj1.Status = 0L;
req.AddApplyRequest_ = obj1;
AlitripBtripApprovalModifyResponse rsp = client.Execute(req, sessionKey);
Console.WriteLine(rsp.Body);
$c = new TopClient;
$c->appkey = $appkey;
$c->secretKey = $secret;
$req = new AlitripBtripApprovalModifyRequest;
$add_apply_request = new OpenApiNewApplyRq;
$add_apply_request->trip_day="2";
$add_apply_request->corp_id="corp123";
$add_apply_request->corp_name="淘宝";
$add_apply_request->user_name="张三";
$add_apply_request->user_id="user123";
$add_apply_request->apply_id="12345";
$traveler_list = new OpenUserInfo;
$traveler_list->user_name="张三";
$traveler_list->user_id="user123";
$add_apply_request->traveler_list = $traveler_list;
$add_apply_request->trip_title="我的出差申请";
$add_apply_request->trip_cause="项目交接";
$add_apply_request->depart_id="depart123";
$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->apply_show_id="12345";
$add_apply_request->depart_name="综合部";
$add_apply_request->status="0";
$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.modify' \
-d 'partner_id=apidoc' \
-d 'session=aa49c031-a5b3-4c96-adcd-0988e90b7ce3' \
-d 'sign=85EC1AA99EC25CD49A03B5466FF97E26' \
-d 'sign_method=hmac' \
-d 'timestamp=2025-01-31+16%3A53%3A15' \
-d 'v=2.0' \
-d 'add_apply_request=null'
# -*- coding: utf-8 -*-
import top.api
req=top.api.AlitripBtripApprovalModifyRequest(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.modify");
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.modify', {
'add_apply_request':'数据结构JSON示例'
}, function(error, response) {
if (!error) console.log(response);
else console.log(error);
})