TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
TmallProductSchemaAddRequest req = new TmallProductSchemaAddRequest();
req.setCategoryId(1512L);
req.setBrandId(12345L);
req.setXmlData("<itemrule><field id=\"prop_14837340 \" name=\"体积 (含包装)\" type=\"input \"></field></itemrule>");
TmallProductSchemaAddResponse rsp = client.execute(req, sessionKey);
System.out.println(rsp.getBody());
ITopClient client = new DefaultTopClient(url, appkey, secret);
TmallProductSchemaAddRequest req = new TmallProductSchemaAddRequest();
req.CategoryId = 1512L;
req.BrandId = 12345L;
req.XmlData = "<itemrule><field id=\"prop_14837340 \" name=\"体积 (含包装)\" type=\"input \"></field></itemrule>";
TmallProductSchemaAddResponse rsp = client.Execute(req, sessionKey);
Console.WriteLine(rsp.Body);
$c = new TopClient;
$c->appkey = $appkey;
$c->secretKey = $secret;
$req = new TmallProductSchemaAddRequest;
$req->setCategoryId("1512");
$req->setBrandId("12345");
$req->setXmlData("<itemrule><field id=\"prop_14837340 \" name=\"体积 (含包装)\" type=\"input \"></field></itemrule>");
$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=tmall.product.schema.add' \
-d 'partner_id=apidoc' \
-d 'session=4060223e-4d31-4d38-b79a-0ab01bb0f5a2' \
-d 'sign=12DCE69DB4E153A4D02A98B911D78E99' \
-d 'sign_method=hmac' \
-d 'timestamp=2025-04-24+16%3A00%3A15' \
-d 'v=2.0' \
-d 'brand_id=12345' \
-d 'category_id=1512' \
-d 'xml_data=%3Citemrule%3E%3Cfield+id%3D%5C%22prop_14837340+%5C%22+name%3D%5C%22%E4%BD%93%E7%A7%AF+%28%E5%90%AB%E5%8C%85%E8%A3%85%29%5C%22+type%3D%5C%22input+%5C%22%3E%3C%2Ffield%3E%3C%2Fitemrule%3E'
# -*- coding: utf-8 -*-
import top.api
req=top.api.TmallProductSchemaAddRequest(url,port)
req.set_app_info(top.appinfo(appkey,secret))
req.category_id=1512
req.brand_id=12345
req.xml_data="<itemrule><field id=\"prop_14837340 \" name=\"体积 (含包装)\" type=\"input \"></field></itemrule>"
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,"tmall.product.schema.add");
add_param(pRequest,"category_id","1512");
add_param(pRequest,"brand_id","12345");
add_param(pRequest,"xml_data","<itemrule><field id=\"prop_14837340 \" name=\"体积 (含包装)\" type=\"input \"></field></itemrule>");
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('tmall.product.schema.add', {
'category_id':'1512',
'brand_id':'12345',
'xml_data':'<itemrule><field id=\"prop_14837340 \" name=\"体积 (含包装)\" type=\"input \"></field></itemrule>'
}, function(error, response) {
if (!error) console.log(response);
else console.log(error);
})