TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
CainiaoEndpointLockerTopStationAddorupdateRequest req = new CainiaoEndpointLockerTopStationAddorupdateRequest();
CainiaoEndpointLockerTopStationAddorupdateRequest.StationInfo obj1 = new CainiaoEndpointLockerTopStationAddorupdateRequest.StationInfo();
obj1.setZip("100000");
obj1.setStationLng("120.129872");
obj1.setStationAddr("翡翠城二期(竹苑)");
obj1.setStationId("1232321");
obj1.setStatus(0L);
obj1.setStationName("翡翠城代收点");
obj1.setHousingEstate("翡翠城");
obj1.setStationNo("1232321");
obj1.setCity("杭州市");
obj1.setImgUrl("http://www.taobao.com");
obj1.setStationLat("30.127655");
obj1.setProvince("浙江省");
obj1.setCoordType("MARS");
obj1.setTown("五常街道");
obj1.setDistrict("余杭区");
obj1.setExtra("{'rest_of_week':'6,7','service_time':'8:00-20:00'}");
obj1.setStationType(100L);
obj1.setContact("18677622666");
req.setStationInfo(obj1);
CainiaoEndpointLockerTopStationAddorupdateResponse rsp = client.execute(req);
System.out.println(rsp.getBody());
ITopClient client = new DefaultTopClient(url, appkey, secret);
CainiaoEndpointLockerTopStationAddorupdateRequest req = new CainiaoEndpointLockerTopStationAddorupdateRequest();
CainiaoEndpointLockerTopStationAddorupdateRequest.StationInfoDomain obj1 = new CainiaoEndpointLockerTopStationAddorupdateRequest.StationInfoDomain();
obj1.Zip = "100000";
obj1.StationLng = "120.129872";
obj1.StationAddr = "翡翠城二期(竹苑)";
obj1.StationId = "1232321";
obj1.Status = 0L;
obj1.StationName = "翡翠城代收点";
obj1.HousingEstate = "翡翠城";
obj1.StationNo = "1232321";
obj1.City = "杭州市";
obj1.ImgUrl = "http://www.taobao.com";
obj1.StationLat = "30.127655";
obj1.Province = "浙江省";
obj1.CoordType = "MARS";
obj1.Town = "五常街道";
obj1.District = "余杭区";
obj1.Extra = "{'rest_of_week':'6,7','service_time':'8:00-20:00'}";
obj1.StationType = 100L;
obj1.Contact = "18677622666";
req.StationInfo_ = obj1;
CainiaoEndpointLockerTopStationAddorupdateResponse rsp = client.Execute(req);
Console.WriteLine(rsp.Body);
$c = new TopClient;
$c->appkey = $appkey;
$c->secretKey = $secret;
$req = new CainiaoEndpointLockerTopStationAddorupdateRequest;
$station_info = new StationInfo;
$station_info->zip="100000";
$station_info->station_lng="120.129872";
$station_info->station_addr="翡翠城二期(竹苑)";
$station_info->station_id="1232321";
$station_info->status="0";
$station_info->station_name="翡翠城代收点";
$station_info->housing_estate="翡翠城";
$station_info->station_no="1232321";
$station_info->city="杭州市";
$station_info->img_url="http://www.taobao.com";
$station_info->station_lat="30.127655";
$station_info->province="浙江省";
$station_info->coord_type="MARS";
$station_info->town="五常街道";
$station_info->district="余杭区";
$station_info->extra="{'rest_of_week':'6,7','service_time':'8:00-20:00'}";
$station_info->station_type="100";
$station_info->contact="18677622666";
$req->setStationInfo(json_encode($station_info));
$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=cainiao.endpoint.locker.top.station.addorupdate' \
-d 'partner_id=apidoc' \
-d 'sign=492BE97D380BD8F5E725D77E5BFE5745' \
-d 'sign_method=hmac' \
-d 'timestamp=2025-04-25+18%3A39%3A51' \
-d 'v=2.0' \
-d 'station_info=null'
# -*- coding: utf-8 -*-
import top.api
req=top.api.CainiaoEndpointLockerTopStationAddorupdateRequest(url,port)
req.set_app_info(top.appinfo(appkey,secret))
req.station_info=""
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,"cainiao.endpoint.locker.top.station.addorupdate");
add_param(pRequest,"station_info","数据结构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('cainiao.endpoint.locker.top.station.addorupdate', {
'station_info':'数据结构JSON示例'
}, function(error, response) {
if (!error) console.log(response);
else console.log(error);
})