The AddCategory API adds a category.

Request parameters

Parameters Type Required or not Description
Action String Yes API of the action, system required parameter. Value: AddCategory
CateName String Yes Category name,
  • which consists of up to 64 bytes.
  • UTF-8 encoding.
ParentId Long No Parent category ID.

If this parameter is not set, a level 1 category is generated by default. The root node category ID is -1.

Response parameters

Parameter Type Description
Category Category Category information

Examples

Request example
http://mts.cn-hangzhou.aliyuncs.com?CateName=this%20is%20a%20new%20cate&&<public paramete>

Response example

XML
<AddCategoryResponse>
      <Category>
        <CateId>7503631</CateId>
        <ParentId>-1</ParentId>
        <CateName>this is a new cate</CateName>
        <Level>0</Level>
      </Category>
      <RequestId>E0DB3781-F1D7-4D77-A1EA-137F87F16E2C</RequestId>
    </AddCategoryResponse>
JSON
{
        "Category": {
            "CateId": 7503631, 
            "ParentId": -1, 
            "CateName": "this is a new cate", 
            "Level": 0
        }, 
        "RequestId": "EFFE963A-5862-4CA2-A939-671DEFB35BF9"
    }