TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
LogisticsAddressQueryRequest req = new LogisticsAddressQueryRequest();
LogisticsAddressQueryRequest.AddressRequest obj1 = new LogisticsAddressQueryRequest.AddressRequest();
obj1.setRequestId("1691997065571");
obj1.setRequestTime(1691997065571L);
List<LogisticsAddressQueryRequest.AddressName> list3 = new ArrayList<LogisticsAddressQueryRequest.AddressName>();
LogisticsAddressQueryRequest.AddressName obj4 = new LogisticsAddressQueryRequest.AddressName();
list3.add(obj4);
obj4.setProvince("浙江省");
obj4.setCity("杭州市");
obj4.setArea("余杭区");
obj4.setTown("五常街道");
obj1.setAddressNames(list3);
obj1.setGetChildren(true);
req.setAddressRequest(obj1);
LogisticsAddressQueryResponse rsp = client.execute(req);
System.out.println(rsp.getBody());
ITopClient client = new DefaultTopClient(url, appkey, secret);
LogisticsAddressQueryRequest req = new LogisticsAddressQueryRequest();
LogisticsAddressQueryRequest.AddressRequestDomain obj1 = new LogisticsAddressQueryRequest.AddressRequestDomain();
obj1.RequestId = "1691997065571";
obj1.RequestTime = 1691997065571L;
List<LogisticsAddressQueryRequest.AddressNameDomain> list3 = new List<LogisticsAddressQueryRequest.AddressNameDomain>();
LogisticsAddressQueryRequest.AddressNameDomain obj4 = new LogisticsAddressQueryRequest.AddressNameDomain();
list3.Add(obj4);
obj4.Province = "浙江省";
obj4.City = "杭州市";
obj4.Area = "余杭区";
obj4.Town = "五常街道";
obj1.AddressNames= list3;
obj1.GetChildren = true;
req.AddressRequest_ = obj1;
LogisticsAddressQueryResponse rsp = client.Execute(req);
Console.WriteLine(rsp.Body);
$c = new TopClient;
$c->appkey = $appkey;
$c->secretKey = $secret;
$req = new LogisticsAddressQueryRequest;
$address_request = new AddressRequest;
$address_request->request_id="1691997065571";
$address_request->request_time="1691997065571";
$address_names = new AddressName;
$address_names->province="浙江省";
$address_names->city="杭州市";
$address_names->area="余杭区";
$address_names->town="五常街道";
$address_request->address_names = $address_names;
$address_request->get_children="true";
$req->setAddressRequest(json_encode($address_request));
$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.logistics.address.query' \
-d 'partner_id=apidoc' \
-d 'sign=0A94883F4C4F53AFCC970B99B55816E4' \
-d 'sign_method=hmac' \
-d 'timestamp=2025-05-04+15%3A44%3A16' \
-d 'v=2.0' \
-d 'address_request=null'
# -*- coding: utf-8 -*-
import top.api
req=top.api.LogisticsAddressQueryRequest(url,port)
req.set_app_info(top.appinfo(appkey,secret))
req.address_request="数据结构示例JSON格式"
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.logistics.address.query");
add_param(pRequest,"address_request","数据结构JSON示例");
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.logistics.address.query', {
'address_request':'数据结构JSON示例'
}, function(error, response) {
if (!error) console.log(response);
else console.log(error);
})