All Products
Search
Document Center

GetCategories

Last Updated: Mar 04, 2019

Description

You can call this operation to obtain the specified category information and a list of its subcategories (that is, its lower-level categories).

Request parameters

NameTypeRequiredDescription
ActionStringYesThe operation that you want to perform. Set the value to GetCategories.
CateIdLongNoThe category ID.
Default value: -1 (indicating the root node category ID).
PageNoLongNoThe page number of the subcategory list.
Default value: 1.
PageSizeLongNoThe number of data records on each page of the subcategory list. Maximum value: 100.
Default value: 10.

Response parameters

NameTypeDescription
RequestId String The GUID generated by Alibaba Cloud for the request.
Category Category The information about the specified category.
SubTotal Long The total number of subcategories.
SubCategoriesCategory[]The subcategory list.

Examples

Sample requests

  1. http://vod.cn-shanghai.aliyuncs.com/?Action=GetCategories&CateId=67788823&Format=JSON&<Common request parameters>

Note: For more information about common request parameters, see Common parameters.

Sample responses

JSON format

  1. {
  2. "RequestId": "25818875-5F78-4A13-BEF6-D7393642CA58",
  3. "Category": {
  4. "CateId": 67788823,
  5. "CateName": "exampleCategory-A",
  6. "ParentId": -1,
  7. "Level": 0
  8. },
  9. "SubTotal": 2,
  10. "SubCategories": {
  11. "Category": [
  12. {
  13. "CateId": 87788825,
  14. "CateName": "exampleCategory-A-sub1",
  15. "ParentId": 67788823,
  16. "Level": 1
  17. },
  18. {
  19. "CateId": 87788826,
  20. "CateName": "exampleCategory-A-sub2",
  21. "ParentId": 67788823,
  22. "Level": 1
  23. }
  24. ]
  25. }
  26. }

Error codes

The following table lists the error code that this operation can return. For more information, see Error codes.

Error codeError messageHTTP status codeDescription
InvalidCateId.NotFoundThe CateId not exist.404The error message returned when the specified category ID does not exist.