TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
AlitripBtripCityCarApplyAddRequest req = new AlitripBtripCityCarApplyAddRequest();
AlitripBtripCityCarApplyAddRequest.CityCarApplyAddRq obj1 = new AlitripBtripCityCarApplyAddRequest.CityCarApplyAddRq();
obj1.setCause("杭州出差");
obj1.setCity("杭州");
obj1.setCorpId("corpx");
obj1.setDate(StringUtils.parseDateTime("2021-03-18 20:26:56"));
obj1.setProjectCode("projectx");
obj1.setProjectName("项目x");
obj1.setStatus(0L);
obj1.setThirdPartApplyId("apply1");
obj1.setThirdPartCostCenterId("costcenter1");
obj1.setThirdPartInvoiceId("invoice1");
obj1.setTimesTotal(1L);
obj1.setTimesType(3L);
obj1.setTimesUsed(0L);
obj1.setTitle("杭州出差");
obj1.setUserId("user1");
obj1.setFinishedDate(StringUtils.parseDateTime("2021-03-30 20:26:56"));
req.setRq(obj1);
AlitripBtripCityCarApplyAddResponse rsp = client.execute(req, sessionKey);
System.out.println(rsp.getBody());
ITopClient client = new DefaultTopClient(url, appkey, secret);
AlitripBtripCityCarApplyAddRequest req = new AlitripBtripCityCarApplyAddRequest();
AlitripBtripCityCarApplyAddRequest.CityCarApplyAddRqDomain obj1 = new AlitripBtripCityCarApplyAddRequest.CityCarApplyAddRqDomain();
obj1.Cause = "杭州出差";
obj1.City = "杭州";
obj1.CorpId = "corpx";
obj1.Date = DateTime.Parse(2021-03-18 20:26:56");
obj1.ProjectCode = "projectx";
obj1.ProjectName = "项目x";
obj1.Status = 0L;
obj1.ThirdPartApplyId = "apply1";
obj1.ThirdPartCostCenterId = "costcenter1";
obj1.ThirdPartInvoiceId = "invoice1";
obj1.TimesTotal = 1L;
obj1.TimesType = 3L;
obj1.TimesUsed = 0L;
obj1.Title = "杭州出差";
obj1.UserId = "user1";
obj1.FinishedDate = DateTime.Parse(2021-03-30 20:26:56");
req.Rq_ = obj1;
AlitripBtripCityCarApplyAddResponse rsp = client.Execute(req, sessionKey);
Console.WriteLine(rsp.Body);
$c = new TopClient;
$c->appkey = $appkey;
$c->secretKey = $secret;
$req = new AlitripBtripCityCarApplyAddRequest;
$rq = new CityCarApplyAddRq;
$rq->cause="杭州出差";
$rq->city="杭州";
$rq->corp_id="corpx";
$rq->date="2021-03-18 20:26:56";
$rq->project_code="projectx";
$rq->project_name="项目x";
$rq->status="0";
$rq->third_part_apply_id="apply1";
$rq->third_part_cost_center_id="costcenter1";
$rq->third_part_invoice_id="invoice1";
$rq->times_total="1";
$rq->times_type="3";
$rq->times_used="0";
$rq->title="杭州出差";
$rq->user_id="user1";
$rq->finished_date="2021-03-30 20:26:56";
$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.city.car.apply.add' \
-d 'partner_id=apidoc' \
-d 'session=2113c485-d698-4b57-9b72-7efddddb48e7' \
-d 'sign=C73403EFEFD46E3700675E795135E9E7' \
-d 'sign_method=hmac' \
-d 'timestamp=2024-11-21+19%3A43%3A15' \
-d 'v=2.0' \
-d 'rq=null'
# -*- coding: utf-8 -*-
import top.api
req=top.api.AlitripBtripCityCarApplyAddRequest(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.city.car.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.city.car.apply.add', {
'rq':'数据结构JSON示例'
}, function(error, response) {
if (!error) console.log(response);
else console.log(error);
})