Appearance
ListFile
Lists detailed information for one or more documents in a specified category.
Operation description
A RAM user must obtain database permissions for Alibaba Cloud Model Studio and join a workspace before calling this API. The required permission is
AliyunBailianDataFullAccess, which includes the `sfm:ListFile` permission. An Alibaba Cloud account can call this API directly without authorization. To call this API, use the latest version of the Alibaba Cloud Model Studio SDK.To perform a paged query, use the
MaxResultsparameter to specify the number of items to return on each page. The response returns aNextToken. To retrieve the next page of results, include theNextTokenfrom the previous response in your next request. If the response does not return aNextToken, all results have been returned.This API operation is idempotent.
Throttling Frequent calls to this API are throttled. Do not call this operation more than 5 times 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:ListFile | list | *All Resource* | None | None |
Request syntax
HELPCODEESCAPE-plaintext
GET /{WorkspaceId}/datacenter/files HTTP/1.1Request parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
| WorkspaceId | string | Yes | The ID of the workspace where the category resides. For more information, see How to use workspaces. | llm-3shx2gu255oqxxxx |
| CategoryId | string | Yes | The ID of the category. This is the `CategoryId` returned by the AddCategory operation. You can also obtain the ID on the Unstructured Data tab of the Application Data page by clicking the ID icon next to the category name. | cate_cdd11b1b79a74e8bbd675c356a91ee35xxxxxxxx |
| NextToken | string | No | The token that is used to retrieve the next page of results. Set this parameter to the `NextToken` value that is returned in the previous call. | AAAAAdH70eOCSCKtacdomNzak4U= |
| MaxResults | integer | No | The number of entries to return on each page. Valid values: 1 to 200. Default value: If you do not set this parameter or set it to a value less than 1, the default value is 20. If you set it to a value greater than 200, the default value is 200. | 20 |
| FileName | string | No | The name of the file, excluding the extension. Only exact matches are supported. Fuzzy searches are not supported. | product-overview |
Response elements
| Parameter | Type | Description | Example |
|---|---|---|---|
| object | The response object. | ||
| Code | string | The error code. | success |
| Data | object | The returned data. | |
| FileList | array | A list of documents in the category. | |
| object | The document object. | ||
| CategoryId | string | The ID of the category to which the document belongs. | cate_cdd11b1b79a74e8bbd675c356a91ee35xxxxxxxx |
| CreateTime | string | The time when the document was added to Alibaba Cloud Model Studio. The time is in the `yyyy-MM-dd HH:mm:ss` format. The time zone is UTC+8. | 2024-09-09 11:03:35 |
| FileId | string | The ID of the document. This is the `FileId` returned by the AddFile operation. You can also obtain the ID by clicking the icon next to the document name on the Application Data page. | file_5ff599b3455a45db8c41b0054b361518_xxxxxxxx |
| FileName | string | The name of the document. | XXXproduct-overview.pdf |
| FileType | string | The format of the document. Valid values: pdf, docx, doc, txt, md, pptx, ppt, xlsx, xls, html, png, jpg, jpeg, bmp, and gif. | docx |
| Parser | string | The document parser. Valid values: - DASHSCOPE_DOCMIND: Alibaba Cloud Document Mind. | DASHSCOPE_DOCMIND |
| SizeInBytes | integer | The size of the document in bytes. | 512 |
| Status | string | The parsing status of the document. Valid values: - INIT: The document is being initialized and is waiting to be scheduled. - PARSING: The document is being parsed. - PARSE_SUCCESS: The document is parsed. - PARSE_FAILED: The document failed to be parsed. | PARSE_SUCCESS |
| Tags | array | A list of tags that are added to the document. You can associate multiple tags with a document. | |
| string | The tag of the document. | product-overview | |
| HasNext | boolean | Indicates whether a next page of results exists. Valid values: - true: Yes. - false: No. | true |
| MaxResults | integer | The number of entries returned on each page. | 20 |
| NextToken | string | The token that is used to retrieve the next page of results. | 4jzbJk9J6lNeuXD9hP0viA== |
| TotalCount | integer | The total number of entries returned. | 48 |
| Message | string | The error message. | Requests throttling triggered. |
| RequestId | string | The ID of the request. | 8F97A63B-xxxx-527F-9D6E-467B6A7E8CF1 |
| Status | string | The HTTP status code. | 200 |
| Success | boolean | Indicates whether the request was successful. Valid values: - true: The request was successful. - false: The request failed. | true |
Examples
Success response
JSON format
HELPCODEESCAPE-json
{
"Code": "success",
"Data": {
"FileList": [
{
"CategoryId": "cate_cdd11b1b79a74e8bbd675c356a91ee35xxxxxxxx",
"CreateTime": "2024-09-09 11:03:35",
"FileId": "file_5ff599b3455a45db8c41b0054b361518_xxxxxxxx",
"FileName": "XXXproduct-overview.pdf",
"FileType": "docx",
"Parser": "DASHSCOPE_DOCMIND",
"SizeInBytes": 512,
"Status": "PARSE_SUCCESS",
"Tags": [
"product-overview"
]
}
],
"HasNext": true,
"MaxResults": 20,
"NextToken": "4jzbJk9J6lNeuXD9hP0viA==",
"TotalCount": 48
},
"Message": "Requests throttling triggered.",
"RequestId": "8F97A63B-xxxx-527F-9D6E-467B6A7E8CF1",
"Status": "200",
"Success": true
}Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.