TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
TrainAgentExpressSetRequest req = new TrainAgentExpressSetRequest();
req.setMainOrderId(1L);
req.setExpressId("1");
req.setAddr("北京");
req.setMobile("13900000000");
req.setAgentId(123L);
req.setExpressName("SF");
TrainAgentExpressSetResponse rsp = client.execute(req);
System.out.println(rsp.getBody());
ITopClient client = new DefaultTopClient(url, appkey, secret);
TrainAgentExpressSetRequest req = new TrainAgentExpressSetRequest();
req.MainOrderId = 1L;
req.ExpressId = "1";
req.Addr = "北京";
req.Mobile = "13900000000";
req.AgentId = 123L;
req.ExpressName = "SF";
TrainAgentExpressSetResponse rsp = client.Execute(req);
Console.WriteLine(rsp.Body);
$c = new TopClient;
$c->appkey = $appkey;
$c->secretKey = $secret;
$req = new TrainAgentExpressSetRequest;
$req->setMainOrderId("1");
$req->setExpressId("1");
$req->setAddr("北京");
$req->setMobile("13900000000");
$req->setAgentId("123");
$req->setExpressName("SF");
$resp = $c->execute($req);
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=taobao.train.agent.express.set' \
-d 'partner_id=apidoc' \
-d 'sign=F6947989342D5DE51A6317B1D0550955' \
-d 'sign_method=hmac' \
-d 'timestamp=2024-11-21+16%3A59%3A57' \
-d 'v=2.0' \
-d 'addr=%E5%8C%97%E4%BA%AC' \
-d 'agent_id=123' \
-d 'express_id=1' \
-d 'express_name=SF' \
-d 'main_order_id=1' \
-d 'mobile=13900000000'
# -*- coding: utf-8 -*-
import top.api
req=top.api.TrainAgentExpressSetRequest(url,port)
req.set_app_info(top.appinfo(appkey,secret))
req.main_order_id=1
req.express_id="1"
req.addr="北京"
req.mobile="13900000000"
req.agent_id=123
req.express_name="SF"
try:
resp= req.getResponse()
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,"taobao.train.agent.express.set");
add_param(pRequest,"main_order_id","1");
add_param(pRequest,"express_id","1");
add_param(pRequest,"addr","北京");
add_param(pRequest,"mobile","13900000000");
add_param(pRequest,"agent_id","123");
add_param(pRequest,"express_name","SF");
pResponse = top_execute(pClient,pRequest,NULL);
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('taobao.train.agent.express.set', {
'main_order_id':'1',
'express_id':'1',
'addr':'北京',
'mobile':'13900000000',
'agent_id':'123',
'express_name':'SF'
}, function(error, response) {
if (!error) console.log(response);
else console.log(error);
})