TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
AlibabaImapCategoryPredictRequest req = new AlibabaImapCategoryPredictRequest();
AlibabaImapCategoryPredictRequest.FixedMappingAppInfo obj1 = new AlibabaImapCategoryPredictRequest.FixedMappingAppInfo();
obj1.setPassword("gEzsP9NyWNPvLAqM");
obj1.setAppName("test_app_name");
req.setFixedMappingAppInfo(obj1);
AlibabaImapCategoryPredictRequest.TopImapItemDo obj2 = new AlibabaImapCategoryPredictRequest.TopImapItemDo();
obj2.setItemId("123");
obj2.setTargetChannelId(31L);
obj2.setBrandName("苹果");
obj2.setSrcCatNamePathList("手机");
obj2.setSrcChannelId(1L);
List<AlibabaImapCategoryPredictRequest.TopPVPairDO> list4 = new ArrayList<AlibabaImapCategoryPredictRequest.TopPVPairDO>();
AlibabaImapCategoryPredictRequest.TopPVPairDO obj5 = new AlibabaImapCategoryPredictRequest.TopPVPairDO();
list4.add(obj5);
obj5.setValueId(1L);
obj5.setPropertyName("11");
obj5.setValueName("1");
obj5.setPropertyId(11L);
obj2.setPvPairDoList(list4);
obj2.setBarcodeList(""690001"");
obj2.setTitle("iphone 11 pro max");
obj2.setTargetCategoryId(456L);
obj2.setSrcCategoryId(522201L);
req.setTopImapItemDo(obj2);
AlibabaImapCategoryPredictResponse rsp = client.execute(req);
System.out.println(rsp.getBody());
ITopClient client = new DefaultTopClient(url, appkey, secret);
AlibabaImapCategoryPredictRequest req = new AlibabaImapCategoryPredictRequest();
AlibabaImapCategoryPredictRequest.FixedMappingAppInfoDomain obj1 = new AlibabaImapCategoryPredictRequest.FixedMappingAppInfoDomain();
obj1.Password = "gEzsP9NyWNPvLAqM";
obj1.AppName = "test_app_name";
req.FixedMappingAppInfo_ = obj1;
AlibabaImapCategoryPredictRequest.TopImapItemDoDomain obj2 = new AlibabaImapCategoryPredictRequest.TopImapItemDoDomain();
obj2.ItemId = "123";
obj2.TargetChannelId = 31L;
obj2.BrandName = "苹果";
obj2.SrcCatNamePathList = "手机";
obj2.SrcChannelId = 1L;
List<AlibabaImapCategoryPredictRequest.TopPVPairDODomain> list4 = new List<AlibabaImapCategoryPredictRequest.TopPVPairDODomain>();
AlibabaImapCategoryPredictRequest.TopPVPairDODomain obj5 = new AlibabaImapCategoryPredictRequest.TopPVPairDODomain();
list4.Add(obj5);
obj5.ValueId = 1L;
obj5.PropertyName = "11";
obj5.ValueName = "1";
obj5.PropertyId = 11L;
obj2.PvPairDoList= list4;
obj2.BarcodeList = ""690001"";
obj2.Title = "iphone 11 pro max";
obj2.TargetCategoryId = 456L;
obj2.SrcCategoryId = 522201L;
req.TopImapItemDo_ = obj2;
AlibabaImapCategoryPredictResponse rsp = client.Execute(req);
Console.WriteLine(rsp.Body);
$c = new TopClient;
$c->appkey = $appkey;
$c->secretKey = $secret;
$req = new AlibabaImapCategoryPredictRequest;
$fixed_mapping_app_info = new FixedMappingAppInfo;
$fixed_mapping_app_info->password="gEzsP9NyWNPvLAqM";
$fixed_mapping_app_info->app_name="test_app_name";
$req->setFixedMappingAppInfo(json_encode($fixed_mapping_app_info));
$top_imap_item_do = new TopImapItemDo;
$top_imap_item_do->item_id="123";
$top_imap_item_do->target_channel_id="31";
$top_imap_item_do->brand_name="苹果";
$top_imap_item_do->src_cat_name_path_list="手机";
$top_imap_item_do->src_channel_id="1";
$pv_pair_do_list = new TopPVPairDO;
$pv_pair_do_list->value_id="1";
$pv_pair_do_list->property_name="11";
$pv_pair_do_list->value_name="1";
$pv_pair_do_list->property_id="11";
$top_imap_item_do->pv_pair_do_list = $pv_pair_do_list;
$top_imap_item_do->barcode_list="[\"690001\"]";
$top_imap_item_do->title="iphone 11 pro max";
$top_imap_item_do->target_category_id="456";
$top_imap_item_do->src_category_id="522201";
$req->setTopImapItemDo(json_encode($top_imap_item_do));
$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.imap.category.predict' \
-d 'partner_id=apidoc' \
-d 'sign=AA8A373601F2CEA4B905E665D9682ED2' \
-d 'sign_method=hmac' \
-d 'timestamp=2025-05-16+15%3A50%3A53' \
-d 'v=2.0' \
-d 'fixed_mapping_app_info=null' \
-d 'top_imap_item_do=null'
# -*- coding: utf-8 -*-
import top.api
req=top.api.AlibabaImapCategoryPredictRequest(url,port)
req.set_app_info(top.appinfo(appkey,secret))
req.fixed_mapping_app_info=""
req.top_imap_item_do=""
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.imap.category.predict");
add_param(pRequest,"fixed_mapping_app_info","数据结构JSON示例");
add_param(pRequest,"top_imap_item_do","数据结构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.imap.category.predict', {
'fixed_mapping_app_info':'数据结构JSON示例',
'top_imap_item_do':'数据结构JSON示例'
}, function(error, response) {
if (!error) console.log(response);
else console.log(error);
})