TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
AlitripBtripCorpopUserSyncRequest req = new AlitripBtripCorpopUserSyncRequest();
AlitripBtripCorpopUserSyncRequest.BtripUserSyncRq obj1 = new AlitripBtripCorpopUserSyncRequest.BtripUserSyncRq();
List<AlitripBtripCorpopUserSyncRequest.UserSyncRq> list3 = new ArrayList<AlitripBtripCorpopUserSyncRequest.UserSyncRq>();
AlitripBtripCorpopUserSyncRequest.UserSyncRq obj4 = new AlitripBtripCorpopUserSyncRequest.UserSyncRq();
list3.add(obj4);
obj4.setEmail("123@163.com");
obj4.setPhone("12311112222");
obj4.setDepartId(10L);
obj4.setLeaveStatus(0L);
obj4.setPositionLevel("20");
obj4.setPosition("开发");
obj4.setRealNameEn("xiaoming");
obj4.setUserName("小明");
obj4.setUserId("123");
obj4.setJobNo("8797");
obj4.setThirdDepartId("test001");
obj4.setThirdDepartIdList(""1","2","3"");
obj4.setManagerUserId("123456");
obj4.setBaseCityCode("330100");
obj1.setUserList(list3);
obj1.setCorpId("12345");
req.setRq(obj1);
AlitripBtripCorpopUserSyncResponse rsp = client.execute(req, sessionKey);
System.out.println(rsp.getBody());
ITopClient client = new DefaultTopClient(url, appkey, secret);
AlitripBtripCorpopUserSyncRequest req = new AlitripBtripCorpopUserSyncRequest();
AlitripBtripCorpopUserSyncRequest.BtripUserSyncRqDomain obj1 = new AlitripBtripCorpopUserSyncRequest.BtripUserSyncRqDomain();
List<AlitripBtripCorpopUserSyncRequest.UserSyncRqDomain> list3 = new List<AlitripBtripCorpopUserSyncRequest.UserSyncRqDomain>();
AlitripBtripCorpopUserSyncRequest.UserSyncRqDomain obj4 = new AlitripBtripCorpopUserSyncRequest.UserSyncRqDomain();
list3.Add(obj4);
obj4.Email = "123@163.com";
obj4.Phone = "12311112222";
obj4.DepartId = 10L;
obj4.LeaveStatus = 0L;
obj4.PositionLevel = "20";
obj4.Position = "开发";
obj4.RealNameEn = "xiaoming";
obj4.UserName = "小明";
obj4.UserId = "123";
obj4.JobNo = "8797";
obj4.ThirdDepartId = "test001";
obj4.ThirdDepartIdList = ""1","2","3"";
obj4.ManagerUserId = "123456";
obj4.BaseCityCode = "330100";
obj1.UserList= list3;
obj1.CorpId = "12345";
req.Rq_ = obj1;
AlitripBtripCorpopUserSyncResponse rsp = client.Execute(req, sessionKey);
Console.WriteLine(rsp.Body);
$c = new TopClient;
$c->appkey = $appkey;
$c->secretKey = $secret;
$req = new AlitripBtripCorpopUserSyncRequest;
$rq = new BtripUserSyncRq;
$user_list = new UserSyncRq;
$user_list->email="123@163.com";
$user_list->phone="12311112222";
$user_list->depart_id="10";
$user_list->leave_status="0";
$user_list->position_level="20";
$user_list->position="开发";
$user_list->real_name_en="xiaoming";
$user_list->user_name="小明";
$user_list->user_id="123";
$user_list->job_no="8797";
$user_list->third_depart_id="test001";
$user_list->third_depart_id_list="[\"1\",\"2\",\"3\"]";
$user_list->manager_user_id="123456";
$user_list->base_city_code="330100";
$rq->user_list = $user_list;
$rq->corp_id="12345";
$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.user.sync' \
-d 'partner_id=apidoc' \
-d 'session=ae6d168b-b2a3-45f6-8f3a-af8667a27a7c' \
-d 'sign=309DE988FEECD65F58FCF9DFF0630CF3' \
-d 'sign_method=hmac' \
-d 'timestamp=2024-11-21+19%3A35%3A32' \
-d 'v=2.0' \
-d 'rq=null'
# -*- coding: utf-8 -*-
import top.api
req=top.api.AlitripBtripCorpopUserSyncRequest(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.user.sync");
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.user.sync', {
'rq':'数据结构JSON示例'
}, function(error, response) {
if (!error) console.log(response);
else console.log(error);
})