文档中心 > API类目 > 智能设备

alibaba.ailabs.iot.business.recipe.insertorupdate (插入和更新食谱)

插入和更新食谱,将isv的食谱添加到云端进行存储

公共参数

请求参数

名称 类型 是否必须 示例值 更多限制 描述
param_business_recipe_open_param BusinessRecipeOpenParam 可选 行业食谱开放参数
  • └ description
  • String
  • 可选
  • 美味豆浆
  • 菜谱描述
  • └ dev_type_id
  • Number
  • 必须
  • 11
  • 品类Id
  • └ recipe_id
  • Number
  • 可选
  • 1
  • 食谱id
  • └ open_account_id
  • String
  • 必须
  • 0yl8oK0WFDBwEheQxSMD4g==
  • 开放账号id
  • recipe_image
  • ImageUrlParam
  • 可选
  • 食谱图片
  • └ img
  • String
  • 可选
  • www.xxx.com
  • 默认图片
  • └ large
  • String
  • 可选
  • www.xxx.com
  • 大图
  • └ medium
  • String
  • 可选
  • www.xxx.com
  • 中图
  • └ small
  • String
  • 可选
  • www.xxx.com
  • 小图
  • recipe_ingredient_list
  • RecipeIngredientParam []
  • 可选
  • 重量及单位
  • └ name
  • String
  • 可选
  • 豆子
  • 参数名
  • └ weight
  • String
  • 可选
  • 300g
  • 重量及单位
  • └ recipe_name_cn
  • String
  • 必须
  • xxxx
  • 食谱中文名
  • └ recipe_type
  • Number
  • 必须
  • 1
  • 食谱类型 0视频菜谱 1图文菜谱
  • recipe_video
  • VideoUrlParam
  • 可选
  • 食谱视频
  • cover
  • ImageUrlParam
  • 可选
  • 视频封面图
  • └ img
  • String
  • 可选
  • www.xxx.com
  • 默认图片
  • └ large
  • String
  • 可选
  • www.xxx.com
  • 大图
  • └ medium
  • String
  • 可选
  • www.xxx.com
  • 中图
  • └ small
  • String
  • 可选
  • www.xxx.com
  • 小图
  • └ default_url
  • String
  • 可选
  • www.xxx.com
  • 默认播放链接
  • └ height
  • Number
  • 可选
  • 240
  • 视频高度
  • └ high
  • String
  • 可选
  • www.xxx.com
  • 高清
  • └ standard
  • String
  • 可选
  • www.xxx.com
  • 标清
  • └ ultra
  • String
  • 可选
  • www.xxx.com
  • 超清
  • └ width
  • Number
  • 可选
  • 375
  • 视频宽度
  • └ tag_id_list
  • Number []
  • 可选
  • 10805801
  • 标签列表
  • └ tips
  • String
  • 可选
  • 制作5分钟
  • 菜谱提示信息

响应参数

名称 类型 示例值 描述
message String null 信息
ret_code Number 200 响应code
ret_value Number 1 返回结果,行业食谱Id
trace_id String 1e0525b315754507465865759e 追踪id

请求示例

  • JAVA
  • .NET
  • PHP
  • CURL
  • Python
  • C/C++
  • NodeJS
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());

响应示例

  • XML示例
  • JSON示例
<alibaba_ailabs_iot_business_recipe_insertorupdate_response>
    <message>null</message>
    <ret_code>200</ret_code>
    <ret_value>1</ret_value>
    <trace_id>1e0525b315754507465865759e</trace_id>
</alibaba_ailabs_iot_business_recipe_insertorupdate_response>

异常示例

  • XML示例
  • JSON示例
<error_response>
    <code>50</code>
    <msg>Remote service error</msg>
    <sub_code>isv.invalid-parameter</sub_code>
    <sub_msg>非法参数</sub_msg>
</error_response>

错误码解释

错误码 错误描述 解决方案

API工具

如何获得此API

FAQ

返回
顶部