TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
AlibabaIcbuOpenProductPostRequest req = new AlibabaIcbuOpenProductPostRequest();
ProductPost obj1 = new ProductPost();
obj1.setGroupId(1857394L);
obj1.setKeywords(""hello","world"");
obj1.setSubject("hello world");
obj1.setDescription("hello world");
obj1.setCategoryId(15363783L);
ProductTrade obj2 = new ProductTrade();
obj2.setMoneyType(123L);
obj2.setPriceRangeMin("12");
obj2.setPriceRangeMax("34");
obj2.setPriceUnit(123L);
obj2.setMinOrderQuantity("12");
obj2.setMinOrderUnit(123L);
obj2.setMinOrderOther("min order desc");
obj2.setPaymentMethods(""tt","lc"");
obj2.setPaymentMethodOther("other desc");
obj2.setPort("Shanghai");
obj2.setSupplyQuantity("100");
obj2.setSupplyUnit(123L);
obj2.setSupplyPeriod("week");
obj2.setSupplyOther("other desc");
obj2.setConsignmentTerm("within 3 days");
obj2.setPackagingDesc("package desc");
obj1.setProductTrade(obj2);
ProductImage obj3 = new ProductImage();
List<ImageFile> list5 = new ArrayList<ImageFile>();
ImageFile obj6 = new ImageFile();
list5.add(obj6);
obj6.setImageFileUrl("hello world");
obj3.setImageFileList(list5);
obj3.setImageWatermark(false);
obj1.setProductImage(obj3);
List<ProductProperty> list8 = new ArrayList<ProductProperty>();
ProductProperty obj9 = new ProductProperty();
list8.add(obj9);
obj1.setProperties(list8);
obj1.setProductId(1784652L);
obj1.setExtraContextString("key:value");
req.setParamProductPost(obj1);
AlibabaIcbuOpenProductPostResponse rsp = client.execute(req, sessionKey);
System.out.println(rsp.getBody());
ITopClient client = new DefaultTopClient(url, appkey, secret);
AlibabaIcbuOpenProductPostRequest req = new AlibabaIcbuOpenProductPostRequest();
ProductPost obj1 = new ProductPost();
obj1.GroupId = 1857394L;
obj1.Keywords = ""hello","world"";
obj1.Subject = "hello world";
obj1.Description = "hello world";
obj1.CategoryId = 15363783L;
ProductTrade obj2 = new ProductTrade();
obj2.MoneyType = 123L;
obj2.PriceRangeMin = "12";
obj2.PriceRangeMax = "34";
obj2.PriceUnit = 123L;
obj2.MinOrderQuantity = "12";
obj2.MinOrderUnit = 123L;
obj2.MinOrderOther = "min order desc";
obj2.PaymentMethods = ""tt","lc"";
obj2.PaymentMethodOther = "other desc";
obj2.Port = "Shanghai";
obj2.SupplyQuantity = "100";
obj2.SupplyUnit = 123L;
obj2.SupplyPeriod = "week";
obj2.SupplyOther = "other desc";
obj2.ConsignmentTerm = "within 3 days";
obj2.PackagingDesc = "package desc";
obj1.ProductTrade= obj2;
ProductImage obj3 = new ProductImage();
List<ImageFile> list5 = new List<ImageFile>();
ImageFile obj6 = new ImageFile();
list5.Add(obj6);
obj6.ImageFileUrl = "hello world";
obj3.ImageFileList= list5;
obj3.ImageWatermark = false;
obj1.ProductImage= obj3;
List<ProductProperty> list8 = new List<ProductProperty>();
ProductProperty obj9 = new ProductProperty();
list8.Add(obj9);
obj1.Properties= list8;
obj1.ProductId = 1784652L;
obj1.ExtraContext = "key:value";
req.ParamProductPost_ = obj1;
AlibabaIcbuOpenProductPostResponse rsp = client.Execute(req, sessionKey);
Console.WriteLine(rsp.Body);
$c = new TopClient;
$c->appkey = $appkey;
$c->secretKey = $secret;
$req = new AlibabaIcbuOpenProductPostRequest;
$param_product_post = new ProductPost;
$param_product_post->group_id="1857394";
$param_product_post->keywords="[\"hello\",\"world\"]";
$param_product_post->subject="hello world";
$param_product_post->description="hello world";
$param_product_post->category_id="15363783";
$product_trade = new ProductTrade;
$product_trade->money_type="123";
$product_trade->price_range_min="12";
$product_trade->price_range_max="34";
$product_trade->price_unit="123";
$product_trade->min_order_quantity="12";
$product_trade->min_order_unit="123";
$product_trade->min_order_other="min order desc";
$product_trade->payment_methods="[\"tt\",\"lc\"]";
$product_trade->payment_method_other="other desc";
$product_trade->port="Shanghai";
$product_trade->supply_quantity="100";
$product_trade->supply_unit="123";
$product_trade->supply_period="week";
$product_trade->supply_other="other desc";
$product_trade->consignment_term="within 3 days";
$product_trade->packaging_desc="package desc";
$param_product_post->product_trade = $product_trade;
$product_image = new ProductImage;
$image_file_list = new ImageFile;
$image_file_list->image_file_url="hello world";
$product_image->image_file_list = $image_file_list;
$product_image->image_watermark="false";
$param_product_post->product_image = $product_image;
$properties = new ProductProperty;
$param_product_post->properties = $properties;
$param_product_post->product_id="1784652";
$param_product_post->extra_context=json_decode("key:value");
$req->setParamProductPost(json_encode($param_product_post));
$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.icbu.open.product.post' \
-d 'partner_id=apidoc' \
-d 'session=ccaa3bcf-1e00-4b09-9c96-e1cda1625a75' \
-d 'sign=5309C1FB6282C7ECF02C5E20EBE2625E' \
-d 'sign_method=hmac' \
-d 'timestamp=2024-11-22+00%3A27%3A21' \
-d 'v=2.0' \
-d 'param_product_post=null'
# -*- coding: utf-8 -*-
import top.api
req=top.api.AlibabaIcbuOpenProductPostRequest(url,port)
req.set_app_info(top.appinfo(appkey,secret))
req.param_product_post="数据结构示例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.icbu.open.product.post");
add_param(pRequest,"param_product_post","数据结构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.icbu.open.product.post', {
'param_product_post':'数据结构JSON示例'
}, function(error, response) {
if (!error) console.log(response);
else console.log(error);
})