TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
AlibabaJymItemExternalGoodsBatchPublishRequest req = new AlibabaJymItemExternalGoodsBatchPublishRequest();
AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPublishCommandDto obj1 = new AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPublishCommandDto();
obj1.setExternalBatchId("1629098275");
List<AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPublishDto> list3 = new ArrayList<AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPublishDto>();
AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPublishDto obj4 = new AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPublishDto();
list3.add(obj4);
obj4.setSupportRetrieveCompensation(true);
List<AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPropertyValueDto> list7 = new ArrayList<AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPropertyValueDto>();
AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPropertyValueDto obj8 = new AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPropertyValueDto();
list7.add(obj8);
obj8.setValue("账号");
obj8.setValueId(1213L);
obj8.setPropertyId(123L);
list5.setSellerAccountPropertyList(list7);
List<AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPropertyValueDto> list11 = new ArrayList<AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPropertyValueDto>();
AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPropertyValueDto obj12 = new AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPropertyValueDto();
list11.add(obj12);
obj12.setValue("英雄数量");
obj12.setValueId(1213L);
obj12.setPropertyId(123L);
list9.setGoodsPropertyList(list11);
AlibabaJymItemExternalGoodsBatchPublishRequest.GamePropertyDto obj14 = new AlibabaJymItemExternalGoodsBatchPublishRequest.GamePropertyDto();
obj14.setServerId(124L);
obj14.setClientId(12L);
obj14.setPlatformId(1L);
obj14.setGameId(10000L);
list13.setGameProperty(obj14);
obj4.setSecondCategoryId(10L);
obj4.setFirstCategoryId(1L);
List<AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPublishImageDto> list17 = new ArrayList<AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPublishImageDto>();
AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPublishImageDto obj18 = new AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPublishImageDto();
list17.add(obj18);
obj18.setImageUrl("http://www.xxx.xx/xx.jpg");
list15.setImageUrlList(list17);
AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsBaseInfoDto obj20 = new AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsBaseInfoDto();
obj20.setTitle("xx商品");
obj20.setPrice("9.99");
obj20.setStorage(1L);
obj20.setDescription("xx商品描述");
list19.setGoodsBaseInfo(obj20);
obj4.setExternalGoodsId("1629098275");
obj4.setCanBargain(true);
AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPublishImageDTO obj22 = new AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPublishImageDTO();
obj22.setImageUrl("http://www.xxx.xx/xx.jpg");
list21.setTaobaoFirstImage(obj22);
List<AlibabaJymItemExternalGoodsBatchPublishRequest.MultiPropertyValueDTO> list25 = new ArrayList<AlibabaJymItemExternalGoodsBatchPublishRequest.MultiPropertyValueDTO>();
AlibabaJymItemExternalGoodsBatchPublishRequest.MultiPropertyValueDTO obj26 = new AlibabaJymItemExternalGoodsBatchPublishRequest.MultiPropertyValueDTO();
list25.add(obj26);
obj26.setPropertyName("希儿");
List<AlibabaJymItemExternalGoodsBatchPublishRequest.PropertyValueDTO> list29 = new ArrayList<AlibabaJymItemExternalGoodsBatchPublishRequest.PropertyValueDTO>();
AlibabaJymItemExternalGoodsBatchPublishRequest.PropertyValueDTO obj30 = new AlibabaJymItemExternalGoodsBatchPublishRequest.PropertyValueDTO();
list29.add(obj30);
obj30.setValue("参考demo");
List<AlibabaJymItemExternalGoodsBatchPublishRequest.ChildPropertyKeyValueDTO> list33 = new ArrayList<AlibabaJymItemExternalGoodsBatchPublishRequest.ChildPropertyKeyValueDTO>();
AlibabaJymItemExternalGoodsBatchPublishRequest.ChildPropertyKeyValueDTO obj34 = new AlibabaJymItemExternalGoodsBatchPublishRequest.ChildPropertyKeyValueDTO();
list33.add(obj34);
obj34.setKey("参考demo");
obj34.setValue("参考demo");
list31.setChildPropertyKeyValueList(list33);
list27.setPropertyValueList(list29);
list23.setMultiPropertyValueList(list25);
obj4.setIsUseSmartPublish(false);
obj1.setGoodsList(list3);
req.setGoodsPublishCommand(obj1);
AlibabaJymItemExternalGoodsBatchPublishResponse rsp = client.execute(req);
System.out.println(rsp.getBody());
ITopClient client = new DefaultTopClient(url, appkey, secret);
AlibabaJymItemExternalGoodsBatchPublishRequest req = new AlibabaJymItemExternalGoodsBatchPublishRequest();
AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPublishCommandDtoDomain obj1 = new AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPublishCommandDtoDomain();
obj1.ExternalBatchId = "1629098275";
List<AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPublishDtoDomain> list3 = new List<AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPublishDtoDomain>();
AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPublishDtoDomain obj4 = new AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPublishDtoDomain();
list3.Add(obj4);
obj4.SupportRetrieveCompensation = true;
List<AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPropertyValueDtoDomain> list6 = new List<AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPropertyValueDtoDomain>();
AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPropertyValueDtoDomain obj7 = new AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPropertyValueDtoDomain();
list6.Add(obj7);
obj7.Value = "账号";
obj7.ValueId = 1213L;
obj7.PropertyId = 123L;
obj4.SellerAccountPropertyList= list6;
List<AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPropertyValueDtoDomain> list9 = new List<AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPropertyValueDtoDomain>();
AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPropertyValueDtoDomain obj10 = new AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPropertyValueDtoDomain();
list9.Add(obj10);
obj10.Value = "英雄数量";
obj10.ValueId = 1213L;
obj10.PropertyId = 123L;
obj4.GoodsPropertyList= list9;
AlibabaJymItemExternalGoodsBatchPublishRequest.GamePropertyDtoDomain obj11 = new AlibabaJymItemExternalGoodsBatchPublishRequest.GamePropertyDtoDomain();
obj11.ServerId = 124L;
obj11.ClientId = 12L;
obj11.PlatformId = 1L;
obj11.GameId = 10000L;
obj4.GameProperty= obj11;
obj4.SecondCategoryId = 10L;
obj4.FirstCategoryId = 1L;
List<AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPublishImageDtoDomain> list13 = new List<AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPublishImageDtoDomain>();
AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPublishImageDtoDomain obj14 = new AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPublishImageDtoDomain();
list13.Add(obj14);
obj14.ImageUrl = "http://www.xxx.xx/xx.jpg";
obj4.ImageUrlList= list13;
AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsBaseInfoDtoDomain obj15 = new AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsBaseInfoDtoDomain();
obj15.Title = "xx商品";
obj15.Price = "9.99";
obj15.Storage = 1L;
obj15.Description = "xx商品描述";
obj4.GoodsBaseInfo= obj15;
obj4.ExternalGoodsId = "1629098275";
obj4.CanBargain = true;
AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPublishImageDTODomain obj16 = new AlibabaJymItemExternalGoodsBatchPublishRequest.GoodsPublishImageDTODomain();
obj16.ImageUrl = "http://www.xxx.xx/xx.jpg";
obj4.TaobaoFirstImage= obj16;
List<AlibabaJymItemExternalGoodsBatchPublishRequest.MultiPropertyValueDTODomain> list18 = new List<AlibabaJymItemExternalGoodsBatchPublishRequest.MultiPropertyValueDTODomain>();
AlibabaJymItemExternalGoodsBatchPublishRequest.MultiPropertyValueDTODomain obj19 = new AlibabaJymItemExternalGoodsBatchPublishRequest.MultiPropertyValueDTODomain();
list18.Add(obj19);
obj19.PropertyName = "希儿";
List<AlibabaJymItemExternalGoodsBatchPublishRequest.PropertyValueDTODomain> list21 = new List<AlibabaJymItemExternalGoodsBatchPublishRequest.PropertyValueDTODomain>();
AlibabaJymItemExternalGoodsBatchPublishRequest.PropertyValueDTODomain obj22 = new AlibabaJymItemExternalGoodsBatchPublishRequest.PropertyValueDTODomain();
list21.Add(obj22);
obj22.Value = "参考demo";
List<AlibabaJymItemExternalGoodsBatchPublishRequest.ChildPropertyKeyValueDTODomain> list24 = new List<AlibabaJymItemExternalGoodsBatchPublishRequest.ChildPropertyKeyValueDTODomain>();
AlibabaJymItemExternalGoodsBatchPublishRequest.ChildPropertyKeyValueDTODomain obj25 = new AlibabaJymItemExternalGoodsBatchPublishRequest.ChildPropertyKeyValueDTODomain();
list24.Add(obj25);
obj25.Key = "参考demo";
obj25.Value = "参考demo";
obj22.ChildPropertyKeyValueList= list24;
obj19.PropertyValueList= list21;
obj4.MultiPropertyValueList= list18;
obj4.IsUseSmartPublish = false;
obj1.GoodsList= list3;
req.GoodsPublishCommand_ = obj1;
AlibabaJymItemExternalGoodsBatchPublishResponse rsp = client.Execute(req);
Console.WriteLine(rsp.Body);
$c = new TopClient;
$c->appkey = $appkey;
$c->secretKey = $secret;
$req = new AlibabaJymItemExternalGoodsBatchPublishRequest;
$goods_publish_command = new GoodsPublishCommandDto;
$goods_publish_command->external_batch_id="1629098275";
$goods_list = new GoodsPublishDto;
$goods_list->support_retrieve_compensation="true";
$seller_account_property_list = new GoodsPropertyValueDto;
$seller_account_property_list->value="账号";
$seller_account_property_list->value_id="1213";
$seller_account_property_list->property_id="123";
$goods_list->seller_account_property_list = $seller_account_property_list;
$goods_property_list = new GoodsPropertyValueDto;
$goods_property_list->value="英雄数量";
$goods_property_list->value_id="1213";
$goods_property_list->property_id="123";
$goods_list->goods_property_list = $goods_property_list;
$game_property = new GamePropertyDto;
$game_property->server_id="124";
$game_property->client_id="12";
$game_property->platform_id="1";
$game_property->game_id="10000";
$goods_list->game_property = $game_property;
$goods_list->second_category_id="10";
$goods_list->first_category_id="1";
$image_url_list = new GoodsPublishImageDto;
$image_url_list->image_url="http://www.xxx.xx/xx.jpg";
$goods_list->image_url_list = $image_url_list;
$goods_base_info = new GoodsBaseInfoDto;
$goods_base_info->title="xx商品";
$goods_base_info->price="9.99";
$goods_base_info->storage="1";
$goods_base_info->description="xx商品描述";
$goods_list->goods_base_info = $goods_base_info;
$goods_list->external_goods_id="1629098275";
$goods_list->can_bargain="true";
$taobao_first_image = new GoodsPublishImageDTO;
$taobao_first_image->image_url="http://www.xxx.xx/xx.jpg";
$goods_list->taobao_first_image = $taobao_first_image;
$multi_property_value_list = new MultiPropertyValueDTO;
$multi_property_value_list->property_name="希儿";
$property_value_list = new PropertyValueDTO;
$property_value_list->value="参考demo";
$child_property_key_value_list = new ChildPropertyKeyValueDTO;
$child_property_key_value_list->key="参考demo";
$child_property_key_value_list->value="参考demo";
$property_value_list->child_property_key_value_list = $child_property_key_value_list;
$multi_property_value_list->property_value_list = $property_value_list;
$goods_list->multi_property_value_list = $multi_property_value_list;
$goods_list->is_use_smart_publish="false";
$goods_publish_command->goods_list = $goods_list;
$req->setGoodsPublishCommand(json_encode($goods_publish_command));
$resp = $c->execute($req);
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.jym.item.external.goods.batch.publish' \
-d 'partner_id=apidoc' \
-d 'sign=85A85FD02B2725600667C27E167AD872' \
-d 'sign_method=hmac' \
-d 'timestamp=2025-04-29+07%3A02%3A06' \
-d 'v=2.0' \
-d 'goods_publish_command=null'
# -*- coding: utf-8 -*-
import top.api
req=top.api.AlibabaJymItemExternalGoodsBatchPublishRequest(url,port)
req.set_app_info(top.appinfo(appkey,secret))
req.goods_publish_command=""
try:
resp= req.getResponse()
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.jym.item.external.goods.batch.publish");
add_param(pRequest,"goods_publish_command","数据结构JSON示例");
pResponse = top_execute(pClient,pRequest,NULL);
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.jym.item.external.goods.batch.publish', {
'goods_publish_command':'数据结构JSON示例'
}, function(error, response) {
if (!error) console.log(response);
else console.log(error);
})