Appearance
ListCategory
Retrieves the details of one or more categories in a specified workspace.
Operation description
API calls to query structured data tables are not supported.
A RAM user must obtain database permissions for Alibaba Cloud Model Studio and be added to a workspace before calling this API operation. The
AliyunBailianDataFullAccesspermission, which includes thesfm:ListCategorypermission point, is required. An Alibaba Cloud account can call this API operation directly without authorization. You can use the latest version of the Alibaba Cloud Model Studio SDK to call this API operation.When you perform a paged query, set
MaxResultsto specify the number of entries to return on the first page. TheNextTokenvalue in the response is the token for the next page. To query a subsequent page, set theNextTokenparameter to the value from the previous response and specifyMaxResults. IfNextTokenis empty, all results have been returned.This API operation is idempotent.
Throttling: Frequent calls to this API operation are throttled. Do not exceed a frequency of 5 calls per second. If a call is throttled, retry the call later.
Try it now
Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage. Test
RAM authorization
The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:
Action: The actions can be used in the
Actionelement of RAM permission policy statements to grant permissions to perform the operation.API: The API that you can call to perform the action.
Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.
Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.
For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the
Resourceelement of the policy.For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (***** ) in the
Resourceelement of the policy.
Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.
Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.
| Action | Access level | Resource type | Condition key | Dependent action |
|---|---|---|---|---|
| sfm:ListCategory | list | *All Resource * | None | None |
Request syntax
HELPCODEESCAPE-plaintext
POST /{WorkspaceId}/datacenter/categories HTTP/1.1Request parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
| WorkspaceId | string | Yes | The workspace ID. For more information, see Use workspaces. | ws_3Nt27MYcoK191ISp |
| CategoryType | string | Yes | The type of the category to query. Valid values: - UNSTRUCTURED: unstructured category. ** **Note ** API calls to query structured data tables are not supported. | UNSTRUCTURED |
| ParentCategoryId | string | No | The ID of the parent category. | cate_cdd11b1b79a74e8bbd675c356a91ee3XXXXXXXX |
| NextToken | string | No | The query token. Set this parameter to the NextToken value returned from the previous API call. | AAAAAdH70eOCSCKtacdomNzak4U= |
| MaxResults | integer | No | The number of categories to return on each page. Valid values: 1 to 200. Default value: 20. If you set this parameter to a value greater than 200, the value is automatically set to 200. | 20 |
| CategoryName | string | No | Filters the returned category list by category name. This parameter performs an exact match. By default, this parameter is empty, which means that filtering by category name is disabled. | 产品清单 |
Response elements
| Parameter | Type | Description | Example |
|---|---|---|---|
| object | The response schema. | ||
| Code | string | The error status code. | success |
| Data | object | The business data fields of the API operation. | |
| CategoryList | array | The list of categories. | |
| object | The category object. | ||
| CategoryId | string | The category ID. | cate_cdd11b1b79a74e8bbd675c356a91ee3XXXXXXXX |
| CategoryName | string | The category name. | 类目1 |
| CategoryType | string | The category type. Possible values: - UNSTRUCTURED: unstructured category. | UNSTRUCTURED |
| IsDefault | boolean | Indicates whether the category is the default category. Possible values: - true: The category is the default category. - false: The category is not the default category. Default categories cannot be deleted. | true |
| ParentCategoryId | string | The ID of the parent category. | cate_addd11b1b79a74e8bbd675c356a91ee3XXXXXXXX |
| HasNext | boolean | Indicates whether a next page of data exists. Possible values: - true: Yes. - false: No. | true |
| MaxResults | integer | The number of categories returned on each page. | 20 |
| NextToken | string | The query token returned from this call. | AAAAALHWGpGoYCcYMxiFfmlhvh7Z4G8jiXR6IjHYd+M9WQVJ |
| TotalCount | integer | The total number of categories returned. | 20 |
| Message | string | The error message. | workspace id is null or invalid. |
| RequestId | string | The request ID. | 17204B98-xxxx-4F9A-8464-2446A84821CA |
| Status | string | The status code returned by the API operation. | 200 |
| Success | boolean | Indicates whether the call was successful. Possible values: - true: The call was successful. - false: The call failed. | true |
Examples
Success response
JSON format
HELPCODEESCAPE-json
{
"Code": "success",
"Data": {
"CategoryList": [
{
"CategoryId": "cate_cdd11b1b79a74e8bbd675c356a91ee3XXXXXXXX",
"CategoryName": "类目1",
"CategoryType": "UNSTRUCTURED",
"IsDefault": true,
"ParentCategoryId": "cate_addd11b1b79a74e8bbd675c356a91ee3XXXXXXXX"
}
],
"HasNext": true,
"MaxResults": 20,
"NextToken": "AAAAALHWGpGoYCcYMxiFfmlhvh7Z4G8jiXR6IjHYd+M9WQVJ",
"TotalCount": 20
},
"Message": "workspace id is null or invalid.",
"RequestId": "17204B98-xxxx-4F9A-8464-2446A84821CA",
"Status": "200",
"Success": true
}Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.