TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
AlibabaTradeAddressFormSaveRequest req = new AlibabaTradeAddressFormSaveRequest();
AlibabaTradeAddressFormSaveRequest.ContactAddressSaveRequest obj1 = new AlibabaTradeAddressFormSaveRequest.ContactAddressSaveRequest();
AlibabaTradeAddressFormSaveRequest.AddressInfo obj2 = new AlibabaTradeAddressFormSaveRequest.AddressInfo();
obj2.setAddress("MN, United States");
obj2.setAddress2("street 186");
AlibabaTradeAddressFormSaveRequest.DivisionInfo obj3 = new AlibabaTradeAddressFormSaveRequest.DivisionInfo();
obj3.setCode("922865765908000000");
obj3.setName("Abernant");
obj2.setCity(obj3);
AlibabaTradeAddressFormSaveRequest.DivisionInfo obj4 = new AlibabaTradeAddressFormSaveRequest.DivisionInfo();
obj4.setCode("US");
obj4.setName("United States of America");
obj2.setCountry(obj4);
AlibabaTradeAddressFormSaveRequest.DivisionInfo obj5 = new AlibabaTradeAddressFormSaveRequest.DivisionInfo();
obj5.setCode("922865760000000000");
obj5.setIso("AL");
obj5.setName("Alabama");
obj2.setProvince(obj5);
obj2.setZip("55066");
obj1.setAddress(obj2);
obj1.setBuyerEmail("test@qq.com");
AlibabaTradeAddressFormSaveRequest.ContactInfo obj6 = new AlibabaTradeAddressFormSaveRequest.ContactInfo();
obj6.setMobileNo("3534534251");
obj6.setPhoneCode("+1");
obj1.setContact(obj6);
obj1.setContactPerson("jack ma");
obj1.setAddressId(122222L);
obj1.setIsDefault(false);
req.setContactAddress(obj1);
AlibabaTradeAddressFormSaveResponse rsp = client.execute(req, sessionKey);
System.out.println(rsp.getBody());
ITopClient client = new DefaultTopClient(url, appkey, secret);
AlibabaTradeAddressFormSaveRequest req = new AlibabaTradeAddressFormSaveRequest();
AlibabaTradeAddressFormSaveRequest.ContactAddressSaveRequestDomain obj1 = new AlibabaTradeAddressFormSaveRequest.ContactAddressSaveRequestDomain();
AlibabaTradeAddressFormSaveRequest.AddressInfoDomain obj2 = new AlibabaTradeAddressFormSaveRequest.AddressInfoDomain();
obj2.Address = "MN, United States";
obj2.Address2 = "street 186";
AlibabaTradeAddressFormSaveRequest.DivisionInfoDomain obj3 = new AlibabaTradeAddressFormSaveRequest.DivisionInfoDomain();
obj3.Code = "922865765908000000";
obj3.Name = "Abernant";
obj2.City= obj3;
AlibabaTradeAddressFormSaveRequest.DivisionInfoDomain obj4 = new AlibabaTradeAddressFormSaveRequest.DivisionInfoDomain();
obj4.Code = "US";
obj4.Name = "United States of America";
obj2.Country= obj4;
AlibabaTradeAddressFormSaveRequest.DivisionInfoDomain obj5 = new AlibabaTradeAddressFormSaveRequest.DivisionInfoDomain();
obj5.Code = "922865760000000000";
obj5.Iso = "AL";
obj5.Name = "Alabama";
obj2.Province= obj5;
obj2.Zip = "55066";
obj1.Address= obj2;
obj1.BuyerEmail = "test@qq.com";
AlibabaTradeAddressFormSaveRequest.ContactInfoDomain obj6 = new AlibabaTradeAddressFormSaveRequest.ContactInfoDomain();
obj6.MobileNo = "3534534251";
obj6.PhoneCode = "+1";
obj1.Contact= obj6;
obj1.ContactPerson = "jack ma";
obj1.AddressId = 122222L;
obj1.IsDefault = false;
req.ContactAddress_ = obj1;
AlibabaTradeAddressFormSaveResponse rsp = client.Execute(req, sessionKey);
Console.WriteLine(rsp.Body);
$c = new TopClient;
$c->appkey = $appkey;
$c->secretKey = $secret;
$req = new AlibabaTradeAddressFormSaveRequest;
$contact_address = new ContactAddressSaveRequest;
$address = new AddressInfo;
$address->address="MN, United States";
$address->address2="street 186";
$city = new DivisionInfo;
$city->code="922865765908000000";
$city->name="Abernant";
$address->city = $city;
$country = new DivisionInfo;
$country->code="US";
$country->name="United States of America";
$address->country = $country;
$province = new DivisionInfo;
$province->code="922865760000000000";
$province->iso="AL";
$province->name="Alabama";
$address->province = $province;
$address->zip="55066";
$contact_address->address = $address;
$contact_address->buyer_email="test@qq.com";
$contact = new ContactInfo;
$contact->mobile_no="3534534251";
$contact->phone_code="+1";
$contact_address->contact = $contact;
$contact_address->contact_person="jack ma";
$contact_address->address_id="122222";
$contact_address->is_default="false";
$req->setContactAddress(json_encode($contact_address));
$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.trade.address.form.save' \
-d 'partner_id=apidoc' \
-d 'session=a7473f31-0582-47e7-8d7c-2de9d75e8d95' \
-d 'sign=B31229C8F00B208880E8AE1BA14D2662' \
-d 'sign_method=hmac' \
-d 'timestamp=2024-11-22+05%3A02%3A13' \
-d 'v=2.0' \
-d 'contact_address=null'
# -*- coding: utf-8 -*-
import top.api
req=top.api.AlibabaTradeAddressFormSaveRequest(url,port)
req.set_app_info(top.appinfo(appkey,secret))
req.contact_address="数据结构示例JSON格式"
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.trade.address.form.save");
add_param(pRequest,"contact_address","数据结构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.trade.address.form.save', {
'contact_address':'数据结构JSON示例'
}, function(error, response) {
if (!error) console.log(response);
else console.log(error);
})