TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
AlitripBtripCorpopDepartSyncRequest req = new AlitripBtripCorpopDepartSyncRequest();
AlitripBtripCorpopDepartSyncRequest.BtripDepartSyncRq obj1 = new AlitripBtripCorpopDepartSyncRequest.BtripDepartSyncRq();
List<AlitripBtripCorpopDepartSyncRequest.DepartSyncRq> list3 = new ArrayList<AlitripBtripCorpopDepartSyncRequest.DepartSyncRq>();
AlitripBtripCorpopDepartSyncRequest.DepartSyncRq obj4 = new AlitripBtripCorpopDepartSyncRequest.DepartSyncRq();
list3.add(obj4);
obj4.setStatus(0L);
obj4.setDepartPid(10L);
obj4.setDepartName("技术部");
obj4.setDepartId(11L);
obj4.setThirdDepartId("testdepartid001");
obj4.setThirdDepartPid("testdepartpid001");
obj4.setManagerIds("001|002|003");
obj1.setDepartList(list3);
obj1.setCorpId("1");
req.setRq(obj1);
AlitripBtripCorpopDepartSyncResponse rsp = client.execute(req, sessionKey);
System.out.println(rsp.getBody());
ITopClient client = new DefaultTopClient(url, appkey, secret);
AlitripBtripCorpopDepartSyncRequest req = new AlitripBtripCorpopDepartSyncRequest();
AlitripBtripCorpopDepartSyncRequest.BtripDepartSyncRqDomain obj1 = new AlitripBtripCorpopDepartSyncRequest.BtripDepartSyncRqDomain();
List<AlitripBtripCorpopDepartSyncRequest.DepartSyncRqDomain> list3 = new List<AlitripBtripCorpopDepartSyncRequest.DepartSyncRqDomain>();
AlitripBtripCorpopDepartSyncRequest.DepartSyncRqDomain obj4 = new AlitripBtripCorpopDepartSyncRequest.DepartSyncRqDomain();
list3.Add(obj4);
obj4.Status = 0L;
obj4.DepartPid = 10L;
obj4.DepartName = "技术部";
obj4.DepartId = 11L;
obj4.ThirdDepartId = "testdepartid001";
obj4.ThirdDepartPid = "testdepartpid001";
obj4.ManagerIds = "001|002|003";
obj1.DepartList= list3;
obj1.CorpId = "1";
req.Rq_ = obj1;
AlitripBtripCorpopDepartSyncResponse rsp = client.Execute(req, sessionKey);
Console.WriteLine(rsp.Body);
$c = new TopClient;
$c->appkey = $appkey;
$c->secretKey = $secret;
$req = new AlitripBtripCorpopDepartSyncRequest;
$rq = new BtripDepartSyncRq;
$depart_list = new DepartSyncRq;
$depart_list->status="0";
$depart_list->depart_pid="10";
$depart_list->depart_name="技术部";
$depart_list->depart_id="11";
$depart_list->third_depart_id="testdepartid001";
$depart_list->third_depart_pid="testdepartpid001";
$depart_list->manager_ids="001|002|003";
$rq->depart_list = $depart_list;
$rq->corp_id="1";
$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.depart.sync' \
-d 'partner_id=apidoc' \
-d 'session=fd83e933-8edb-4fee-bddd-00aaad1cee1a' \
-d 'sign=ED138F79D49BBF0388705C41636ABC22' \
-d 'sign_method=hmac' \
-d 'timestamp=2024-11-21+23%3A51%3A23' \
-d 'v=2.0' \
-d 'rq=null'
# -*- coding: utf-8 -*-
import top.api
req=top.api.AlitripBtripCorpopDepartSyncRequest(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.depart.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.depart.sync', {
'rq':'数据结构JSON示例'
}, function(error, response) {
if (!error) console.log(response);
else console.log(error);
})