TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
SpuAddRequest req = new SpuAddRequest();
SpuAddRequest.ChannelProductVo obj1 = new SpuAddRequest.ChannelProductVo();
obj1.setExtraImageUrl("http://gw.alicdn.com/tfscom/TB1QtrlQFXXXXcuXVXXXXXXXXXX,http://gw.alicdn.com/tfscom/TB1QtrlQFXXXXcuXVXXXXXXXXXX");
obj1.setKeyPropertyText("品牌:大金/Daikin;型号:MC71NV2C-W");
obj1.setMemo("特选商品");
obj1.setStatus(1L);
obj1.setAffectPropertyText("产品尺寸(长*宽*高)(mm):620*395*230;是否上门安装、调试:是;是否上门维护:是;产品尺寸(高*宽*深)mm:无;CADR洁净空气量:无");
obj1.setMainImageUrl("http://gw.alicdn.com/tfscom/TB1QtrlQFXXXXcuXVXXXXXXXXXX");
obj1.setKeyProperties("政采云渠道为空");
obj1.setAffectProperties("政采云渠道为空");
obj1.setTitle("大金/Daikin MC71NV2C-W");
obj1.setSaleProperties("政采云渠道为空");
obj1.setCatName("空气净化/氧吧");
obj1.setFeatures("300:节能环保;301:新款");
obj1.setSalePropertyText("产品尺寸(高*宽*深)mm:无;CADR洁净空气量:无");
obj1.setCatId(122L);
obj1.setChannel("zcy");
req.setProduct(obj1);
SpuAddResponse rsp = client.execute(req, sessionKey);
System.out.println(rsp.getBody());
ITopClient client = new DefaultTopClient(url, appkey, secret);
SpuAddRequest req = new SpuAddRequest();
SpuAddRequest.ChannelProductVoDomain obj1 = new SpuAddRequest.ChannelProductVoDomain();
obj1.ExtraImageUrl = "http://gw.alicdn.com/tfscom/TB1QtrlQFXXXXcuXVXXXXXXXXXX,http://gw.alicdn.com/tfscom/TB1QtrlQFXXXXcuXVXXXXXXXXXX";
obj1.KeyPropertyText = "品牌:大金/Daikin;型号:MC71NV2C-W";
obj1.Memo = "特选商品";
obj1.Status = 1L;
obj1.AffectPropertyText = "产品尺寸(长*宽*高)(mm):620*395*230;是否上门安装、调试:是;是否上门维护:是;产品尺寸(高*宽*深)mm:无;CADR洁净空气量:无";
obj1.MainImageUrl = "http://gw.alicdn.com/tfscom/TB1QtrlQFXXXXcuXVXXXXXXXXXX";
obj1.KeyProperties = "政采云渠道为空";
obj1.AffectProperties = "政采云渠道为空";
obj1.Title = "大金/Daikin MC71NV2C-W";
obj1.SaleProperties = "政采云渠道为空";
obj1.CatName = "空气净化/氧吧";
obj1.Features = "300:节能环保;301:新款";
obj1.SalePropertyText = "产品尺寸(高*宽*深)mm:无;CADR洁净空气量:无";
obj1.CatId = 122L;
obj1.Channel = "zcy";
req.Product_ = obj1;
SpuAddResponse rsp = client.Execute(req, sessionKey);
Console.WriteLine(rsp.Body);
$c = new TopClient;
$c->appkey = $appkey;
$c->secretKey = $secret;
$req = new SpuAddRequest;
$product = new ChannelProductVo;
$product->extra_image_url="http://gw.alicdn.com/tfscom/TB1QtrlQFXXXXcuXVXXXXXXXXXX,http://gw.alicdn.com/tfscom/TB1QtrlQFXXXXcuXVXXXXXXXXXX";
$product->key_property_text="品牌:大金/Daikin;型号:MC71NV2C-W";
$product->memo="特选商品";
$product->status="1";
$product->affect_property_text="产品尺寸(长*宽*高)(mm):620*395*230;是否上门安装、调试:是;是否上门维护:是;产品尺寸(高*宽*深)mm:无;CADR洁净空气量:无";
$product->main_image_url="http://gw.alicdn.com/tfscom/TB1QtrlQFXXXXcuXVXXXXXXXXXX";
$product->key_properties="政采云渠道为空";
$product->affect_properties="政采云渠道为空";
$product->title="大金/Daikin MC71NV2C-W";
$product->sale_properties="政采云渠道为空";
$product->cat_name="空气净化/氧吧";
$product->features="300:节能环保;301:新款";
$product->sale_property_text="产品尺寸(高*宽*深)mm:无;CADR洁净空气量:无";
$product->cat_id="122";
$product->channel="zcy";
$req->setProduct(json_encode($product));
$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=taobao.spu.add' \
-d 'partner_id=apidoc' \
-d 'session=cbcc9710-d1e0-4d39-ade7-a6994f1cd9a2' \
-d 'sign=182DC410950569B251AAF6D434DC9406' \
-d 'sign_method=hmac' \
-d 'timestamp=2025-05-25+22%3A52%3A45' \
-d 'v=2.0' \
-d 'product=null'
# -*- coding: utf-8 -*-
import top.api
req=top.api.SpuAddRequest(url,port)
req.set_app_info(top.appinfo(appkey,secret))
req.product=""
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,"taobao.spu.add");
add_param(pRequest,"product","数据结构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('taobao.spu.add', {
'product':'数据结构JSON示例'
}, function(error, response) {
if (!error) console.log(response);
else console.log(error);
})