文档中心 > API类目 > 多媒体平台API

taobao.picture.category.update (更新图片分类)

更新图片分类的名字,或者更新图片分类的父分类(即分类移动)。只能移动2级分类到非2级分类,默认分类和1级分类不可移动。

公共参数

请求参数

名称 类型 是否必须 示例值 更多限制 描述
category_id Number 必须 8426 要更新的图片分类的id
category_name String 可选 手机类图片
  • 最大长度:20
  • 图片分类的新名字,最大长度20字符,不能为空
    parent_id Number 可选 2684 图片分类的新父分类id

    响应参数

    名称 类型 示例值 描述
    done Boolean true 更新图片分类是否成功

    请求示例

    • JAVA
    • .NET
    • PHP
    • CURL
    • Python
    • C/C++
    • NodeJS
    TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
    PictureCategoryUpdateRequest req = new PictureCategoryUpdateRequest();
    req.setCategoryId(8426L);
    req.setCategoryName("手机类图片");
    req.setParentId(2684L);
    PictureCategoryUpdateResponse rsp = client.execute(req, sessionKey);
    System.out.println(rsp.getBody());

    响应示例

    • XML示例
    • JSON示例
    <picture_category_update_response>
        <done>true</done>
    </picture_category_update_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>

    错误码解释

    错误码 错误描述 解决方案
    isv.picture-service-client-service-error:new parent id is illegal 新的父分类id不合法 更换一个合法的父分类id(正整数)
    isv.picture-service-client-service-error:new parentid does not exist 新的父分类id不存在 更换新父分类id
    isv.pictures-service-client-service-error:the same subcategory name already exist 同一父分类下已经有同名的子分类存在 更换分类名参数
    isv.picture-service-client-service-error:ID is illegal 传入非法的图片分类ID(图片分类ID不存在,或者此ID对应的图片分类已被删除,或者图片分类ID所有者不是调接口的用户) 更换图片分类id参数
    isv.picture-service-client-service-error:first-level category can't be moved 不能移动默认分类和1级分类 更换分类id
    isv.picture-service-client-service-error:new parent category can't be second-level 不能把分类移动到2级分类 更改父分类id
    isv.core-service-client-service-error:CATEGORY_NOTEXIST 目录不存在 检查参数

    API工具

    如何获得此API

    FAQ

    返回
    顶部