TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
AlibabaAilabsIotBusinessRecipeInsertorupdateRequest req = new AlibabaAilabsIotBusinessRecipeInsertorupdateRequest();
AlibabaAilabsIotBusinessRecipeInsertorupdateRequest.BusinessRecipeOpenParam obj1 = new AlibabaAilabsIotBusinessRecipeInsertorupdateRequest.BusinessRecipeOpenParam();
obj1.setDescription("美味豆浆");
obj1.setDevTypeId(11L);
obj1.setRecipeId(1L);
obj1.setOpenAccountId("0yl8oK0WFDBwEheQxSMD4g==");
AlibabaAilabsIotBusinessRecipeInsertorupdateRequest.ImageUrlParam obj2 = new AlibabaAilabsIotBusinessRecipeInsertorupdateRequest.ImageUrlParam();
obj2.setImg("www.xxx.com");
obj2.setLarge("www.xxx.com");
obj2.setMedium("www.xxx.com");
obj2.setSmall("www.xxx.com");
obj1.setRecipeImage(obj2);
List<AlibabaAilabsIotBusinessRecipeInsertorupdateRequest.RecipeIngredientParam> list4 = new ArrayList<AlibabaAilabsIotBusinessRecipeInsertorupdateRequest.RecipeIngredientParam>();
AlibabaAilabsIotBusinessRecipeInsertorupdateRequest.RecipeIngredientParam obj5 = new AlibabaAilabsIotBusinessRecipeInsertorupdateRequest.RecipeIngredientParam();
list4.add(obj5);
obj5.setName("豆子");
obj5.setWeight("300g");
obj1.setRecipeIngredientList(list4);
obj1.setRecipeNameCn("xxxx");
obj1.setRecipeType(1L);
AlibabaAilabsIotBusinessRecipeInsertorupdateRequest.VideoUrlParam obj6 = new AlibabaAilabsIotBusinessRecipeInsertorupdateRequest.VideoUrlParam();
AlibabaAilabsIotBusinessRecipeInsertorupdateRequest.ImageUrlParam obj7 = new AlibabaAilabsIotBusinessRecipeInsertorupdateRequest.ImageUrlParam();
obj7.setImg("www.xxx.com");
obj7.setLarge("www.xxx.com");
obj7.setMedium("www.xxx.com");
obj7.setSmall("www.xxx.com");
obj6.setCover(obj7);
obj6.setDefaultUrl("www.xxx.com");
obj6.setHeight(240L);
obj6.setHigh("www.xxx.com");
obj6.setStandard("www.xxx.com");
obj6.setUltra("www.xxx.com");
obj6.setWidth(375L);
obj1.setRecipeVideo(obj6);
obj1.setTagIdList(new Long[] { 10805801 };
);
obj1.setTips("制作5分钟");
req.setParamBusinessRecipeOpenParam(obj1);
AlibabaAilabsIotBusinessRecipeInsertorupdateResponse rsp = client.execute(req);
System.out.println(rsp.getBody());
ITopClient client = new DefaultTopClient(url, appkey, secret);
AlibabaAilabsIotBusinessRecipeInsertorupdateRequest req = new AlibabaAilabsIotBusinessRecipeInsertorupdateRequest();
AlibabaAilabsIotBusinessRecipeInsertorupdateRequest.BusinessRecipeOpenParamDomain obj1 = new AlibabaAilabsIotBusinessRecipeInsertorupdateRequest.BusinessRecipeOpenParamDomain();
obj1.Description = "美味豆浆";
obj1.DevTypeId = 11L;
obj1.RecipeId = 1L;
obj1.OpenAccountId = "0yl8oK0WFDBwEheQxSMD4g==";
AlibabaAilabsIotBusinessRecipeInsertorupdateRequest.ImageUrlParamDomain obj2 = new AlibabaAilabsIotBusinessRecipeInsertorupdateRequest.ImageUrlParamDomain();
obj2.Img = "www.xxx.com";
obj2.Large = "www.xxx.com";
obj2.Medium = "www.xxx.com";
obj2.Small = "www.xxx.com";
obj1.RecipeImage= obj2;
List<AlibabaAilabsIotBusinessRecipeInsertorupdateRequest.RecipeIngredientParamDomain> list4 = new List<AlibabaAilabsIotBusinessRecipeInsertorupdateRequest.RecipeIngredientParamDomain>();
AlibabaAilabsIotBusinessRecipeInsertorupdateRequest.RecipeIngredientParamDomain obj5 = new AlibabaAilabsIotBusinessRecipeInsertorupdateRequest.RecipeIngredientParamDomain();
list4.Add(obj5);
obj5.Name = "豆子";
obj5.Weight = "300g";
obj1.RecipeIngredientList= list4;
obj1.RecipeNameCn = "xxxx";
obj1.RecipeType = 1L;
AlibabaAilabsIotBusinessRecipeInsertorupdateRequest.VideoUrlParamDomain obj6 = new AlibabaAilabsIotBusinessRecipeInsertorupdateRequest.VideoUrlParamDomain();
AlibabaAilabsIotBusinessRecipeInsertorupdateRequest.ImageUrlParamDomain obj7 = new AlibabaAilabsIotBusinessRecipeInsertorupdateRequest.ImageUrlParamDomain();
obj7.Img = "www.xxx.com";
obj7.Large = "www.xxx.com";
obj7.Medium = "www.xxx.com";
obj7.Small = "www.xxx.com";
obj6.Cover= obj7;
obj6.DefaultUrl = "www.xxx.com";
obj6.Height = 240L;
obj6.High = "www.xxx.com";
obj6.Standard = "www.xxx.com";
obj6.Ultra = "www.xxx.com";
obj6.Width = 375L;
obj1.RecipeVideo= obj6;
obj1.TagIdList = new long[] { 10805801 };
;
obj1.Tips = "制作5分钟";
req.ParamBusinessRecipeOpenParam_ = obj1;
AlibabaAilabsIotBusinessRecipeInsertorupdateResponse rsp = client.Execute(req);
Console.WriteLine(rsp.Body);
$c = new TopClient;
$c->appkey = $appkey;
$c->secretKey = $secret;
$req = new AlibabaAilabsIotBusinessRecipeInsertorupdateRequest;
$param_business_recipe_open_param = new BusinessRecipeOpenParam;
$param_business_recipe_open_param->description="美味豆浆";
$param_business_recipe_open_param->dev_type_id="11";
$param_business_recipe_open_param->recipe_id="1";
$param_business_recipe_open_param->open_account_id="0yl8oK0WFDBwEheQxSMD4g==";
$recipe_image = new ImageUrlParam;
$recipe_image->img="www.xxx.com";
$recipe_image->large="www.xxx.com";
$recipe_image->medium="www.xxx.com";
$recipe_image->small="www.xxx.com";
$param_business_recipe_open_param->recipe_image = $recipe_image;
$recipe_ingredient_list = new RecipeIngredientParam;
$recipe_ingredient_list->name="豆子";
$recipe_ingredient_list->weight="300g";
$param_business_recipe_open_param->recipe_ingredient_list = $recipe_ingredient_list;
$param_business_recipe_open_param->recipe_name_cn="xxxx";
$param_business_recipe_open_param->recipe_type="1";
$recipe_video = new VideoUrlParam;
$cover = new ImageUrlParam;
$cover->img="www.xxx.com";
$cover->large="www.xxx.com";
$cover->medium="www.xxx.com";
$cover->small="www.xxx.com";
$recipe_video->cover = $cover;
$recipe_video->default_url="www.xxx.com";
$recipe_video->height="240";
$recipe_video->high="www.xxx.com";
$recipe_video->standard="www.xxx.com";
$recipe_video->ultra="www.xxx.com";
$recipe_video->width="375";
$param_business_recipe_open_param->recipe_video = $recipe_video;
$param_business_recipe_open_param->tag_id_list="10805801";
$param_business_recipe_open_param->tips="制作5分钟";
$req->setParamBusinessRecipeOpenParam(json_encode($param_business_recipe_open_param));
$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.ailabs.iot.business.recipe.insertorupdate' \
-d 'partner_id=apidoc' \
-d 'sign=595517C6F3EF5D4BBA25402B5042689F' \
-d 'sign_method=hmac' \
-d 'timestamp=2025-05-19+18%3A02%3A23' \
-d 'v=2.0' \
-d 'param_business_recipe_open_param=null'
# -*- coding: utf-8 -*-
import top.api
req=top.api.AlibabaAilabsIotBusinessRecipeInsertorupdateRequest(url,port)
req.set_app_info(top.appinfo(appkey,secret))
req.param_business_recipe_open_param=""
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.ailabs.iot.business.recipe.insertorupdate");
add_param(pRequest,"param_business_recipe_open_param","数据结构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.ailabs.iot.business.recipe.insertorupdate', {
'param_business_recipe_open_param':'数据结构JSON示例'
}, function(error, response) {
if (!error) console.log(response);
else console.log(error);
})