TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
AlibabaSellerAddressSaveRequest req = new AlibabaSellerAddressSaveRequest();
AlibabaSellerAddressSaveRequest.TradeEcologyAddressSaveRequest obj1 = new AlibabaSellerAddressSaveRequest.TradeEcologyAddressSaveRequest();
AlibabaSellerAddressSaveRequest.AddressInfo obj2 = new AlibabaSellerAddressSaveRequest.AddressInfo();
obj2.setAddress("New York, NY, USA");
obj2.setAddress2("California, CA, USA");
AlibabaSellerAddressSaveRequest.DivisionInfo obj3 = new AlibabaSellerAddressSaveRequest.DivisionInfo();
obj3.setName("New York");
obj2.setCity(obj3);
AlibabaSellerAddressSaveRequest.DivisionInfo obj4 = new AlibabaSellerAddressSaveRequest.DivisionInfo();
obj4.setName("Unit Station America");
obj4.setCode("US");
obj2.setCountry(obj4);
AlibabaSellerAddressSaveRequest.DivisionInfo obj5 = new AlibabaSellerAddressSaveRequest.DivisionInfo();
obj5.setName("xxx");
obj2.setProvince(obj5);
obj2.setZip("23331231");
obj1.setAddress(obj2);
obj1.setAddressId("24231");
obj1.setBuyerEmail("afafa@qqq.com");
AlibabaSellerAddressSaveRequest.ContactInfo obj6 = new AlibabaSellerAddressSaveRequest.ContactInfo();
obj6.setMobileNo("15988332222");
obj6.setPhoneCode("86");
obj1.setContact(obj6);
obj1.setContactPerson("lihao");
req.setParamTradeEcologyAddressSaveRequest(obj1);
AlibabaSellerAddressSaveResponse rsp = client.execute(req, sessionKey);
System.out.println(rsp.getBody());
ITopClient client = new DefaultTopClient(url, appkey, secret);
AlibabaSellerAddressSaveRequest req = new AlibabaSellerAddressSaveRequest();
AlibabaSellerAddressSaveRequest.TradeEcologyAddressSaveRequestDomain obj1 = new AlibabaSellerAddressSaveRequest.TradeEcologyAddressSaveRequestDomain();
AlibabaSellerAddressSaveRequest.AddressInfoDomain obj2 = new AlibabaSellerAddressSaveRequest.AddressInfoDomain();
obj2.Address = "New York, NY, USA";
obj2.Address2 = "California, CA, USA";
AlibabaSellerAddressSaveRequest.DivisionInfoDomain obj3 = new AlibabaSellerAddressSaveRequest.DivisionInfoDomain();
obj3.Name = "New York";
obj2.City= obj3;
AlibabaSellerAddressSaveRequest.DivisionInfoDomain obj4 = new AlibabaSellerAddressSaveRequest.DivisionInfoDomain();
obj4.Name = "Unit Station America";
obj4.Code = "US";
obj2.Country= obj4;
AlibabaSellerAddressSaveRequest.DivisionInfoDomain obj5 = new AlibabaSellerAddressSaveRequest.DivisionInfoDomain();
obj5.Name = "xxx";
obj2.Province= obj5;
obj2.Zip = "23331231";
obj1.Address= obj2;
obj1.AddressId = "24231";
obj1.BuyerEmail = "afafa@qqq.com";
AlibabaSellerAddressSaveRequest.ContactInfoDomain obj6 = new AlibabaSellerAddressSaveRequest.ContactInfoDomain();
obj6.MobileNo = "15988332222";
obj6.PhoneCode = "86";
obj1.Contact= obj6;
obj1.ContactPerson = "lihao";
req.ParamTradeEcologyAddressSaveRequest_ = obj1;
AlibabaSellerAddressSaveResponse rsp = client.Execute(req, sessionKey);
Console.WriteLine(rsp.Body);
$c = new TopClient;
$c->appkey = $appkey;
$c->secretKey = $secret;
$req = new AlibabaSellerAddressSaveRequest;
$param_trade_ecology_address_save_request = new TradeEcologyAddressSaveRequest;
$address = new AddressInfo;
$address->address="New York, NY, USA";
$address->address2="California, CA, USA";
$city = new DivisionInfo;
$city->name="New York";
$address->city = $city;
$country = new DivisionInfo;
$country->name="Unit Station America";
$country->code="US";
$address->country = $country;
$province = new DivisionInfo;
$province->name="xxx";
$address->province = $province;
$address->zip="23331231";
$param_trade_ecology_address_save_request->address = $address;
$param_trade_ecology_address_save_request->address_id="24231";
$param_trade_ecology_address_save_request->buyer_email="afafa@qqq.com";
$contact = new ContactInfo;
$contact->mobile_no="15988332222";
$contact->phone_code="86";
$param_trade_ecology_address_save_request->contact = $contact;
$param_trade_ecology_address_save_request->contact_person="lihao";
$req->setParamTradeEcologyAddressSaveRequest(json_encode($param_trade_ecology_address_save_request));
$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=alibaba.seller.address.save' \
-d 'partner_id=apidoc' \
-d 'session=ac93255d-661c-4aed-98d2-8e749df53954' \
-d 'sign=42C44898423EC81DFDE3CB0874F14D8B' \
-d 'sign_method=hmac' \
-d 'timestamp=2024-11-22+04%3A29%3A41' \
-d 'v=2.0' \
-d 'param_trade_ecology_address_save_request=null'
# -*- coding: utf-8 -*-
import top.api
req=top.api.AlibabaSellerAddressSaveRequest(url,port)
req.set_app_info(top.appinfo(appkey,secret))
req.param_trade_ecology_address_save_request=""
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,"alibaba.seller.address.save");
add_param(pRequest,"param_trade_ecology_address_save_request","数据结构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('alibaba.seller.address.save', {
'param_trade_ecology_address_save_request':'数据结构JSON示例'
}, function(error, response) {
if (!error) console.log(response);
else console.log(error);
})