TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
AlitripTravelVisaApplicantUpdateRequest req = new AlitripTravelVisaApplicantUpdateRequest();
List<AlitripTravelVisaApplicantUpdateRequest.NormalVisaApplicantInfo> list2 = new ArrayList<AlitripTravelVisaApplicantUpdateRequest.NormalVisaApplicantInfo>();
AlitripTravelVisaApplicantUpdateRequest.NormalVisaApplicantInfo obj3 = new AlitripTravelVisaApplicantUpdateRequest.NormalVisaApplicantInfo();
list2.add(obj3);
obj3.setApplyId("123");
obj3.setSurname("张");
obj3.setGivenName("三");
obj3.setMobile("13777777777");
obj3.setCertNo("E23242");
obj3.setUserType(16L);
obj3.setApplyNameCn("张三");
req.setApplicantInfos(list2);
AlitripTravelVisaApplicantUpdateRequest.NormalVisaApplicantOperation obj4 = new AlitripTravelVisaApplicantUpdateRequest.NormalVisaApplicantOperation();
obj4.setApplyId("123");
AlitripTravelVisaApplicantUpdateRequest.NormalVisaETAInfo obj5 = new AlitripTravelVisaApplicantUpdateRequest.NormalVisaETAInfo();
obj5.setFileName("电子签证结果");
obj4.setEtaInfo(obj5);
AlitripTravelVisaApplicantUpdateRequest.NormalVisaLogisticsInfo obj6 = new AlitripTravelVisaApplicantUpdateRequest.NormalVisaLogisticsInfo();
obj6.setPostNumber("SF1234561234563");
obj6.setPostCompanyCode("SF");
obj6.setPostCompanyName("顺丰速运");
obj6.setConcatPhone("5705");
obj4.setLogisticsInfo(obj6);
obj4.setRemark("商家备注");
obj4.setStatus(1001L);
AlitripTravelVisaApplicantUpdateRequest.NormalVisaAppointmentInfo obj7 = new AlitripTravelVisaApplicantUpdateRequest.NormalVisaAppointmentInfo();
obj7.setBookFileName("预约面试信");
obj7.setBookTime("2018-01-01 10:00:00");
obj7.setBookPlace("预约地点");
obj4.setAppointmentInfo(obj7);
obj4.setNeedModifyDocTypes("0,1,2");
obj4.setApplicantFormDataJson("{\"lastNamePinyin\":\"ZHANG\",\"firstNamePinyin\":\"SAN\",\"nameCh\":\"中文名\",\"passportNumber\":\"G12345678\",\"sex\":\"M\",\"nationality\":\"CHN\",\"birthday\":\"1900-01-01\",\"enterDate\":\"2019-07-01\",\"domesticPhoneNum\":\"15911111111\",\"applicantEmail\":\"12@qq.com\",\"passportValidUntil\": \"2022-10-01\"}");
obj4.setSignResult("10");
req.setApplicantOp(obj4);
req.setOperType(1L);
req.setSubOrderId("1234456");
req.setFileBytes(new FileItem("/tmp/file.txt"));
req.setPhotoBytes(new FileItem("/tmp/file.txt"));
req.setPhotoType("jpg");
req.setPassportBytes(new FileItem("/tmp/file.txt"));
req.setPassportType("jpg");
req.setHotelBookingFormType("jpg");
req.setHotelBookingFormBytes(new FileItem("/tmp/file.txt"));
req.setFlightBookingFormType("png");
req.setFlightBookingFormBytes(new FileItem("/tmp/file.txt"));
List<AlitripTravelVisaApplicantUpdateRequest.NormalVisaDocumentInfo> list9 = new ArrayList<AlitripTravelVisaApplicantUpdateRequest.NormalVisaDocumentInfo>();
AlitripTravelVisaApplicantUpdateRequest.NormalVisaDocumentInfo obj10 = new AlitripTravelVisaApplicantUpdateRequest.NormalVisaDocumentInfo();
list9.add(obj10);
obj10.setDocType(0L);
obj10.setFileType("jpg");
obj10.setFileContent("+EABwAHAA0AFgAgYWNzcEFQUEwAAAAAQVBQTAAAAAAAAAAAAAAAAAAAAAAAAPbWAAEAAAAA0y1hcHBsyhqVgiV");
List<AlitripTravelVisaApplicantUpdateRequest.NormalVisaSubDocumentInfo> list13 = new ArrayList<AlitripTravelVisaApplicantUpdateRequest.NormalVisaSubDocumentInfo>();
AlitripTravelVisaApplicantUpdateRequest.NormalVisaSubDocumentInfo obj14 = new AlitripTravelVisaApplicantUpdateRequest.NormalVisaSubDocumentInfo();
list13.add(obj14);
obj14.setDocType(10001L);
obj14.setFileType("jpg");
obj14.setFileContent("+EABwAHAA0AFgAgYWNzcEFQUEwAAAAAQVBQTAAAAAAAAAAAAAAAAAAAAAAAAPbWAAEAAAAA0y1hcHBsyhqVgiV");
list11.setSubDocumentInfos(list13);
req.setDocumentInfos(list9);
AlitripTravelVisaApplicantUpdateResponse rsp = client.execute(req, sessionKey);
System.out.println(rsp.getBody());
ITopClient client = new DefaultTopClient(url, appkey, secret);
AlitripTravelVisaApplicantUpdateRequest req = new AlitripTravelVisaApplicantUpdateRequest();
List<AlitripTravelVisaApplicantUpdateRequest.NormalVisaApplicantInfoDomain> list2 = new List<AlitripTravelVisaApplicantUpdateRequest.NormalVisaApplicantInfoDomain>();
AlitripTravelVisaApplicantUpdateRequest.NormalVisaApplicantInfoDomain obj3 = new AlitripTravelVisaApplicantUpdateRequest.NormalVisaApplicantInfoDomain();
list2.Add(obj3);
obj3.ApplyId = "123";
obj3.Surname = "张";
obj3.GivenName = "三";
obj3.Mobile = "13777777777";
obj3.CertNo = "E23242";
obj3.UserType = 16L;
obj3.ApplyNameCn = "张三";
req.ApplicantInfos_ = list2;
AlitripTravelVisaApplicantUpdateRequest.NormalVisaApplicantOperationDomain obj4 = new AlitripTravelVisaApplicantUpdateRequest.NormalVisaApplicantOperationDomain();
obj4.ApplyId = "123";
AlitripTravelVisaApplicantUpdateRequest.NormalVisaETAInfoDomain obj5 = new AlitripTravelVisaApplicantUpdateRequest.NormalVisaETAInfoDomain();
obj5.FileName = "电子签证结果";
obj4.EtaInfo= obj5;
AlitripTravelVisaApplicantUpdateRequest.NormalVisaLogisticsInfoDomain obj6 = new AlitripTravelVisaApplicantUpdateRequest.NormalVisaLogisticsInfoDomain();
obj6.PostNumber = "SF1234561234563";
obj6.PostCompanyCode = "SF";
obj6.PostCompanyName = "顺丰速运";
obj6.ConcatPhone = "5705";
obj4.LogisticsInfo= obj6;
obj4.Remark = "商家备注";
obj4.Status = 1001L;
AlitripTravelVisaApplicantUpdateRequest.NormalVisaAppointmentInfoDomain obj7 = new AlitripTravelVisaApplicantUpdateRequest.NormalVisaAppointmentInfoDomain();
obj7.BookFileName = "预约面试信";
obj7.BookTime = "2018-01-01 10:00:00";
obj7.BookPlace = "预约地点";
obj4.AppointmentInfo= obj7;
obj4.NeedModifyDocTypes = "0,1,2";
obj4.ApplicantFormDataJson = "{\"lastNamePinyin\":\"ZHANG\",\"firstNamePinyin\":\"SAN\",\"nameCh\":\"中文名\",\"passportNumber\":\"G12345678\",\"sex\":\"M\",\"nationality\":\"CHN\",\"birthday\":\"1900-01-01\",\"enterDate\":\"2019-07-01\",\"domesticPhoneNum\":\"15911111111\",\"applicantEmail\":\"12@qq.com\",\"passportValidUntil\": \"2022-10-01\"}";
obj4.SignResult = "10";
req.ApplicantOp_ = obj4;
req.OperType = 1L;
req.SubOrderId = "1234456";
req.FileBytes = new FileItem("/tmp/file.txt");
req.PhotoBytes = new FileItem("/tmp/file.txt");
req.PhotoType = "jpg";
req.PassportBytes = new FileItem("/tmp/file.txt");
req.PassportType = "jpg";
req.HotelBookingFormType = "jpg";
req.HotelBookingFormBytes = new FileItem("/tmp/file.txt");
req.FlightBookingFormType = "png";
req.FlightBookingFormBytes = new FileItem("/tmp/file.txt");
List<AlitripTravelVisaApplicantUpdateRequest.NormalVisaDocumentInfoDomain> list9 = new List<AlitripTravelVisaApplicantUpdateRequest.NormalVisaDocumentInfoDomain>();
AlitripTravelVisaApplicantUpdateRequest.NormalVisaDocumentInfoDomain obj10 = new AlitripTravelVisaApplicantUpdateRequest.NormalVisaDocumentInfoDomain();
list9.Add(obj10);
obj10.DocType = 0L;
obj10.FileType = "jpg";
obj10.FileContent = "+EABwAHAA0AFgAgYWNzcEFQUEwAAAAAQVBQTAAAAAAAAAAAAAAAAAAAAAAAAPbWAAEAAAAA0y1hcHBsyhqVgiV";
List<AlitripTravelVisaApplicantUpdateRequest.NormalVisaSubDocumentInfoDomain> list12 = new List<AlitripTravelVisaApplicantUpdateRequest.NormalVisaSubDocumentInfoDomain>();
AlitripTravelVisaApplicantUpdateRequest.NormalVisaSubDocumentInfoDomain obj13 = new AlitripTravelVisaApplicantUpdateRequest.NormalVisaSubDocumentInfoDomain();
list12.Add(obj13);
obj13.DocType = 10001L;
obj13.FileType = "jpg";
obj13.FileContent = "+EABwAHAA0AFgAgYWNzcEFQUEwAAAAAQVBQTAAAAAAAAAAAAAAAAAAAAAAAAPbWAAEAAAAA0y1hcHBsyhqVgiV";
obj10.SubDocumentInfos= list12;
req.DocumentInfos_ = list9;
AlitripTravelVisaApplicantUpdateResponse rsp = client.Execute(req, sessionKey);
Console.WriteLine(rsp.Body);
$c = new TopClient;
$c->appkey = $appkey;
$c->secretKey = $secret;
$req = new AlitripTravelVisaApplicantUpdateRequest;
$applicant_infos = new NormalVisaApplicantInfo;
$applicant_infos->apply_id="123";
$applicant_infos->surname="张";
$applicant_infos->given_name="三";
$applicant_infos->mobile="13777777777";
$applicant_infos->cert_no="E23242";
$applicant_infos->user_type="16";
$applicant_infos->apply_name_cn="张三";
$req->setApplicantInfos(json_encode($applicant_infos));
$applicant_op = new NormalVisaApplicantOperation;
$applicant_op->apply_id="123";
$eta_info = new NormalVisaETAInfo;
$eta_info->file_name="电子签证结果";
$applicant_op->eta_info = $eta_info;
$logistics_info = new NormalVisaLogisticsInfo;
$logistics_info->post_number="SF1234561234563";
$logistics_info->post_company_code="SF";
$logistics_info->post_company_name="顺丰速运";
$logistics_info->concat_phone="5705";
$applicant_op->logistics_info = $logistics_info;
$applicant_op->remark="商家备注";
$applicant_op->status="1001";
$appointment_info = new NormalVisaAppointmentInfo;
$appointment_info->book_file_name="预约面试信";
$appointment_info->book_time="2018-01-01 10:00:00";
$appointment_info->book_place="预约地点";
$applicant_op->appointment_info = $appointment_info;
$applicant_op->need_modify_doc_types="[0,1,2]";
$applicant_op->applicant_form_data_json="{\"lastNamePinyin\":\"ZHANG\",\"firstNamePinyin\":\"SAN\",\"nameCh\":\"中文名\",\"passportNumber\":\"G12345678\",\"sex\":\"M\",\"nationality\":\"CHN\",\"birthday\":\"1900-01-01\",\"enterDate\":\"2019-07-01\",\"domesticPhoneNum\":\"15911111111\",\"applicantEmail\":\"12@qq.com\",\"passportValidUntil\": \"2022-10-01\"}";
$applicant_op->sign_result="10";
$req->setApplicantOp(json_encode($applicant_op));
$req->setOperType("1");
$req->setSubOrderId("1234456");
//附件上传的机制参见PHP CURL文档,在文件路径前加@符号即可
$req->setFileBytes(@fileLocation);
//附件上传的机制参见PHP CURL文档,在文件路径前加@符号即可
$req->setPhotoBytes(@fileLocation);
$req->setPhotoType("jpg");
//附件上传的机制参见PHP CURL文档,在文件路径前加@符号即可
$req->setPassportBytes(@fileLocation);
$req->setPassportType("jpg");
$req->setHotelBookingFormType("jpg");
//附件上传的机制参见PHP CURL文档,在文件路径前加@符号即可
$req->setHotelBookingFormBytes(@fileLocation);
$req->setFlightBookingFormType("png");
//附件上传的机制参见PHP CURL文档,在文件路径前加@符号即可
$req->setFlightBookingFormBytes(@fileLocation);
$document_infos = new NormalVisaDocumentInfo;
$document_infos->doc_type="0";
$document_infos->file_type="jpg";
$document_infos->file_content="+EABwAHAA0AFgAgYWNzcEFQUEwAAAAAQVBQTAAAAAAAAAAAAAAAAAAAAAAAAPbWAAEAAAAA0y1hcHBsyhqVgiV";
$sub_document_infos = new NormalVisaSubDocumentInfo;
$sub_document_infos->doc_type="10001";
$sub_document_infos->file_type="jpg";
$sub_document_infos->file_content="+EABwAHAA0AFgAgYWNzcEFQUEwAAAAAQVBQTAAAAAAAAAAAAAAAAAAAAAAAAPbWAAEAAAAA0y1hcHBsyhqVgiV";
$document_infos->sub_document_infos = $sub_document_infos;
$req->setDocumentInfos(json_encode($document_infos));
$resp = $c->execute($req, $sessionKey);
curl -X POST 'http://gw.api.taobao.com/router/rest' \
-H 'Content-Type:multipart/form-data;charset=utf-8' \
-F 'app_key=12129701' \
-F 'format=json' \
-F 'method=alitrip.travel.visa.applicant.update' \
-F 'partner_id=apidoc' \
-F 'session=f8cbd051-0730-486c-8fe3-23de19414682' \
-F 'sign=25F4374F1D27AA6AC08C5AFC7072E8A3' \
-F 'sign_method=hmac' \
-F 'timestamp=2024-12-05+02%3A54%3A42' \
-F 'v=2.0' \
-F 'applicant_infos=null' \
-F 'applicant_op=null' \
-F 'document_infos=null' \
-F 'flight_booking_form_type=png' \
-F 'hotel_booking_form_type=jpg' \
-F 'oper_type=1' \
-F 'passport_type=jpg' \
-F 'photo_type=jpg' \
-F 'sub_order_id=1234456' \
-F 'file_bytes=@/tmp/file.txt' \
-F 'photo_bytes=@/tmp/file.txt' \
-F 'passport_bytes=@/tmp/file.txt' \
-F 'hotel_booking_form_bytes=@/tmp/file.txt' \
-F 'flight_booking_form_bytes=@/tmp/file.txt'
# -*- coding: utf-8 -*-
import top.api
req=top.api.AlitripTravelVisaApplicantUpdateRequest(url,port)
req.set_app_info(top.appinfo(appkey,secret))
req.applicant_infos=""
req.applicant_op=""
req.oper_type=1
req.sub_order_id="1234456"
req.file_bytes=top.api.FileItem('abc.jpg',open('abc.jpg','rb'))
req.photo_bytes=top.api.FileItem('abc.jpg',open('abc.jpg','rb'))
req.photo_type="jpg"
req.passport_bytes=top.api.FileItem('abc.jpg',open('abc.jpg','rb'))
req.passport_type="jpg"
req.hotel_booking_form_type="jpg"
req.hotel_booking_form_bytes=top.api.FileItem('abc.jpg',open('abc.jpg','rb'))
req.flight_booking_form_type="png"
req.flight_booking_form_bytes=top.api.FileItem('abc.jpg',open('abc.jpg','rb'))
req.document_infos=""
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.travel.visa.applicant.update");
add_param(pRequest,"applicant_infos","数据结构JSON示例");
add_param(pRequest,"applicant_op","数据结构JSON示例");
add_param(pRequest,"oper_type","1");
add_param(pRequest,"sub_order_id","1234456");
add_file_param(pRequest,"file_bytes","文件内容");
add_file_param(pRequest,"photo_bytes","文件内容");
add_param(pRequest,"photo_type","jpg");
add_file_param(pRequest,"passport_bytes","文件内容");
add_param(pRequest,"passport_type","jpg");
add_param(pRequest,"hotel_booking_form_type","jpg");
add_file_param(pRequest,"hotel_booking_form_bytes","文件内容");
add_param(pRequest,"flight_booking_form_type","png");
add_file_param(pRequest,"flight_booking_form_bytes","文件内容");
add_param(pRequest,"document_infos","数据结构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.travel.visa.applicant.update', {
'applicant_infos':'数据结构JSON示例',
'applicant_op':'数据结构JSON示例',
'oper_type':'1',
'sub_order_id':'1234456',
'file_bytes':'文件内容',
'photo_bytes':'文件内容',
'photo_type':'jpg',
'passport_bytes':'文件内容',
'passport_type':'jpg',
'hotel_booking_form_type':'jpg',
'hotel_booking_form_bytes':'文件内容',
'flight_booking_form_type':'png',
'flight_booking_form_bytes':'文件内容',
'document_infos':'数据结构JSON示例'
}, function(error, response) {
if (!error) console.log(response);
else console.log(error);
})