TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
AlitripBtripCostCenterEntitySetRequest req = new AlitripBtripCostCenterEntitySetRequest();
AlitripBtripCostCenterEntitySetRequest.OpenCostCenterSetEntityRq obj1 = new AlitripBtripCostCenterEntitySetRequest.OpenCostCenterSetEntityRq();
obj1.setThirdpartId("cost1");
List<AlitripBtripCostCenterEntitySetRequest.OpenOrgEntityDo> list3 = new ArrayList<AlitripBtripCostCenterEntitySetRequest.OpenOrgEntityDo>();
AlitripBtripCostCenterEntitySetRequest.OpenOrgEntityDo obj4 = new AlitripBtripCostCenterEntitySetRequest.OpenOrgEntityDo();
list3.add(obj4);
obj4.setEntityType("1");
obj4.setEntityId("12345");
obj1.setEntityList(list3);
obj1.setCorpId("corp1");
req.setRq(obj1);
AlitripBtripCostCenterEntitySetResponse rsp = client.execute(req, sessionKey);
System.out.println(rsp.getBody());
ITopClient client = new DefaultTopClient(url, appkey, secret);
AlitripBtripCostCenterEntitySetRequest req = new AlitripBtripCostCenterEntitySetRequest();
AlitripBtripCostCenterEntitySetRequest.OpenCostCenterSetEntityRqDomain obj1 = new AlitripBtripCostCenterEntitySetRequest.OpenCostCenterSetEntityRqDomain();
obj1.ThirdpartId = "cost1";
List<AlitripBtripCostCenterEntitySetRequest.OpenOrgEntityDoDomain> list3 = new List<AlitripBtripCostCenterEntitySetRequest.OpenOrgEntityDoDomain>();
AlitripBtripCostCenterEntitySetRequest.OpenOrgEntityDoDomain obj4 = new AlitripBtripCostCenterEntitySetRequest.OpenOrgEntityDoDomain();
list3.Add(obj4);
obj4.EntityType = "1";
obj4.EntityId = "12345";
obj1.EntityList= list3;
obj1.CorpId = "corp1";
req.Rq_ = obj1;
AlitripBtripCostCenterEntitySetResponse rsp = client.Execute(req, sessionKey);
Console.WriteLine(rsp.Body);
$c = new TopClient;
$c->appkey = $appkey;
$c->secretKey = $secret;
$req = new AlitripBtripCostCenterEntitySetRequest;
$rq = new OpenCostCenterSetEntityRq;
$rq->thirdpart_id="cost1";
$entity_list = new OpenOrgEntityDo;
$entity_list->entity_type="1";
$entity_list->entity_id="12345";
$rq->entity_list = $entity_list;
$rq->corp_id="corp1";
$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.cost.center.entity.set' \
-d 'partner_id=apidoc' \
-d 'session=619de8e4-a853-4dc8-986a-db9903242af1' \
-d 'sign=6FE00C6EDE4FE489F1C340C1286CB52C' \
-d 'sign_method=hmac' \
-d 'timestamp=2025-01-30+12%3A16%3A15' \
-d 'v=2.0' \
-d 'rq=null'
# -*- coding: utf-8 -*-
import top.api
req=top.api.AlitripBtripCostCenterEntitySetRequest(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.cost.center.entity.set");
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.cost.center.entity.set', {
'rq':'数据结构JSON示例'
}, function(error, response) {
if (!error) console.log(response);
else console.log(error);
})