TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
AlibabaAlscSaasDishCategoryCreateRequest req = new AlibabaAlscSaasDishCategoryCreateRequest();
AlibabaAlscSaasDishCategoryCreateRequest.CreateDishCategoryReq obj1 = new AlibabaAlscSaasDishCategoryCreateRequest.CreateDishCategoryReq();
obj1.setBrandId("124223");
AlibabaAlscSaasDishCategoryCreateRequest.DishCategoryBizDTO obj2 = new AlibabaAlscSaasDishCategoryCreateRequest.DishCategoryBizDTO();
obj2.setCategoryId("12423");
obj2.setCategoryName("991822");
obj2.setParentId("2321");
obj2.setSort(1L);
obj1.setDishCategory(obj2);
obj1.setMerchantId("1234");
obj1.setOrgId("3421");
obj1.setUseOutBizId(true);
obj1.setUseOutOrgId(false);
req.setCreateDishCategoryReq(obj1);
AlibabaAlscSaasDishCategoryCreateResponse rsp = client.execute(req);
System.out.println(rsp.getBody());
ITopClient client = new DefaultTopClient(url, appkey, secret);
AlibabaAlscSaasDishCategoryCreateRequest req = new AlibabaAlscSaasDishCategoryCreateRequest();
AlibabaAlscSaasDishCategoryCreateRequest.CreateDishCategoryReqDomain obj1 = new AlibabaAlscSaasDishCategoryCreateRequest.CreateDishCategoryReqDomain();
obj1.BrandId = "124223";
AlibabaAlscSaasDishCategoryCreateRequest.DishCategoryBizDTODomain obj2 = new AlibabaAlscSaasDishCategoryCreateRequest.DishCategoryBizDTODomain();
obj2.CategoryId = "12423";
obj2.CategoryName = "991822";
obj2.ParentId = "2321";
obj2.Sort = 1L;
obj1.DishCategory= obj2;
obj1.MerchantId = "1234";
obj1.OrgId = "3421";
obj1.UseOutBizId = true;
obj1.UseOutOrgId = false;
req.CreateDishCategoryReq_ = obj1;
AlibabaAlscSaasDishCategoryCreateResponse rsp = client.Execute(req);
Console.WriteLine(rsp.Body);
$c = new TopClient;
$c->appkey = $appkey;
$c->secretKey = $secret;
$req = new AlibabaAlscSaasDishCategoryCreateRequest;
$create_dish_category_req = new CreateDishCategoryReq;
$create_dish_category_req->brand_id="124223";
$dish_category = new DishCategoryBizDTO;
$dish_category->category_id="12423";
$dish_category->category_name="991822";
$dish_category->parent_id="2321";
$dish_category->sort="1";
$create_dish_category_req->dish_category = $dish_category;
$create_dish_category_req->merchant_id="1234";
$create_dish_category_req->org_id="3421";
$create_dish_category_req->use_out_biz_id="true";
$create_dish_category_req->use_out_org_id="false";
$req->setCreateDishCategoryReq(json_encode($create_dish_category_req));
$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.alsc.saas.dish.category.create' \
-d 'partner_id=apidoc' \
-d 'sign=70055C29782315794D71D58E4DDF6AF7' \
-d 'sign_method=hmac' \
-d 'timestamp=2025-04-24+16%3A04%3A19' \
-d 'v=2.0' \
-d 'create_dish_category_req=null'
# -*- coding: utf-8 -*-
import top.api
req=top.api.AlibabaAlscSaasDishCategoryCreateRequest(url,port)
req.set_app_info(top.appinfo(appkey,secret))
req.create_dish_category_req=""
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.alsc.saas.dish.category.create");
add_param(pRequest,"create_dish_category_req","数据结构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.alsc.saas.dish.category.create', {
'create_dish_category_req':'数据结构JSON示例'
}, function(error, response) {
if (!error) console.log(response);
else console.log(error);
})