ListIndexFileDetails
Retrieves files and their details from a specified knowledge base.
Operation description
- Resource Access Management (RAM) users must first obtain the API permissions for Alibaba Cloud Model Studio (requires
AliyunBailianDataFullAccess, which includes the sfm:ListIndexFiles permission) before invoking this operation. Alibaba Cloud accounts can invoke this operation directly without authorization. We recommend that you invoke this operation through the latest Alibaba Cloud Model Studio SDK. - Before invoking this operation, make sure your knowledge base has been created and has not been deleted (that is, the knowledge base ID
IndexIdis valid). - This operation has idempotence.
Try it now
You can run this API directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After a successful run, OpenAPI Explorer can automatically generate SDK code examples.
RAM authorization
The following table describes the authorization information of the API, which can be used in the Action element of RAM policy statements to grant RAM users or RAM roles the permission to call this API. Details are as follows:
-
Action: refers to the specific permission.
-
Access level: refers to the access level of each operation. Valid values: Write, Read, or List.
-
Resource type: refers to the resource types that support authorization in the operation. Details:
- For required resource types, an asterisk (*) is prefixed.
- For operations that do not support resource-level authorization,
All Resourcesis used.
-
Condition key: refers to the condition keys defined by the cloud service itself.
-
Dependent action: refers to other permissions required to successfully perform the operation. The operator must have the permissions of all dependent actions at the same time for the operation to succeed.
Action | Access level | Resource type | Condition key | Dependent action |
|---|---|---|---|---|
sfm:ListIndexFileDetails | list | *All Resource
| None | None |
Request syntax
POST /{WorkspaceId}/index/list_index_file_detail HTTP/1.1
Path Parameters
Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
| WorkspaceId | string | Yes | The workspace ID to which the knowledge base belongs. For information about how to obtain the workspace ID, see How to use a workspace. | llm-3z7uw7fwz0vexxxx |
Request parameters
Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
| IndexId | string | No | The knowledge base ID, which is the | 79c0alxxxx |
| DocumentStatus | string | No | Filters the returned file list by file import status. Valid values:
Default value: empty, which means no filtering by file import status. | FINISH |
| DocumentName | string | No | Filters the returned file details list by file name. Default value: empty, which means no filtering by file name. | TranslationPlatformO&MDocument. |
| PageNumber | integer | No | The page number to query. Minimum value: 1. Default value: 1. | 1 |
| PageSize | integer | No | The number of files to display per page in a paging query. Maximum value: 10. | 10 |
| EnableNameLike | string | No | Specifies whether to enable fuzzy matching for file names. This parameter is used together with the
Default value: false. Valid values:
| false |
Response elements
Element | Type | Description | Example |
|---|---|---|---|
object | Schema of Response | ||
| RequestId | string | The request ID. | 35A267BF-xxxx-54DB-8394-AA3B0742D833 |
| Code | string | The error status code. | InvalidParameter |
| Message | string | The error message. | Required parameter(%s) missing or invalid, please check the request parameters. |
| Success | boolean | Indicates whether the operation was successful. Valid values:
| true |
| Data | object | The business data field of the operation. | |
| Documents | array<object> | The list of files in the knowledge base, sorted in descending order by file import time (consistent with the console). | |
object | The file object. | ||
| Status | string | The file import status. Valid values:
| RUNNING |
| EnableHeaders | string | Indicates whether Excel file headers support concatenation. | true |
| Message | string | The file import error message. | check fileUrlKey[file_path] / fileNameKey[null] / fileExtensionKey[file_extension] is invalid |
| Size | integer | The file size, in bytes. | 996764 |
| SourceId | string | The category ID. | cate_21a407a3372c4ba7aedc649709143f0cxxxxxxxx |
| DocumentType | string | The file format type. Valid values: pdf, docx, doc, txt, md, pptx, ppt, png, jpg, jpeg, bmp, gif, EXCEL. | |
| Id | string | The file ID. | doc_c134aa2073204a5d936d870bf960f56axxxxxxxx |
| Code | string | The file import error status code. | 110002 |
| Name | string | The file name. | TranslationPlatformO&MDocument. |
| ChunkSize | string | The chunk length, which is the number of characters in a text chunk. | 600 |
| OverlapSize | string | The chunk overlap length. | 100 |
| ChunkMode | string | The custom chunking mode. | DashSplitter |
| GmtModified | integer | The time when the file was imported to the knowledge base, in Unix timestamp format. | 1744856423000 |
| separator | string | The sentence separator. | " " |
| MetaExtractInfo | string | The meta information extracted from the document. | { "doc_summary": ["Example 1."], "health_rule": ["Example 2"] } |
| IndexId | string | The knowledge base ID. | 79c0alxxxx |
| TotalCount | integer | The total number of returned results. | 2437 |
| PageNumber | integer | The returned page number. | 1 |
| PageSize | integer | The returned number of items per page. | 10 |
| Status | string | The status code returned by the operation. | 200 |
Examples
Success response
JSON format
{
"RequestId": "35A267BF-xxxx-54DB-8394-AA3B0742D833",
"Code": "InvalidParameter\n",
"Message": "Required parameter(%s) missing or invalid, please check the request parameters.",
"Success": true,
"Data": {
"Documents": [
{
"Status": "RUNNING",
"EnableHeaders": "true",
"Message": "check fileUrlKey[file_path] / fileNameKey[null] / fileExtensionKey[file_extension] is invalid",
"Size": 996764,
"SourceId": "cate_21a407a3372c4ba7aedc649709143f0cxxxxxxxx\n",
"DocumentType": "pdf",
"Id": "doc_c134aa2073204a5d936d870bf960f56axxxxxxxx\n",
"Code": "110002",
"Name": "TranslationPlatformO&MDocument.",
"ChunkSize": "600",
"OverlapSize": "100",
"ChunkMode": "DashSplitter",
"GmtModified": 1744856423000,
"separator": "\" \"",
"MetaExtractInfo": "{\n \"doc_summary\": [\"Example 1.\"],\n \"health_rule\": [\"Example 2\"]\n}"
}
],
"IndexId": "79c0alxxxx",
"TotalCount": 2437,
"PageNumber": 1,
"PageSize": 10
},
"Status": "200"
}
Error codes
Visit the Error Center to view more error codes.
Release notes
For more information, see Change details.