Appearance
ListIndexFileDetails
Retrieves the details of one or more documents in a specified knowledge base.
Operation description
A RAM user must have the API permissions for Alibaba Cloud Model Studio to call this operation. The
AliyunBailianDataFullAccesspermission, which includes the `sfm:ListIndexFiles` permission, is required. An Alibaba Cloud account can call this operation without authorization. You can call this operation using the latest version of the Alibaba Cloud Model Studio SDK.Before you call this operation, ensure that your knowledge base exists and its ID,
IndexId, is valid.This operation is idempotent.
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:ListIndexFiles | list | *All Resource * | None | None |
Request syntax
HELPCODEESCAPE-plaintext
POST /{WorkspaceId}/index/list_index_file_detail HTTP/1.1Request parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
| IndexId | string | No | The ID of the knowledge base. This is the value of the Data.Id parameter returned by the CreateIndex operation. | 79c0alxxxx |
| DocumentStatus | string | No | The import status of the documents to return. Valid values: - INSERT_ERROR: The document failed to be imported. - RUNNING: The document is being imported. - DELETED: The document has been deleted. - FINISH: The document was imported successfully. If you do not specify this parameter, the results are not filtered by import status. | FINISH |
| DocumentName | string | No | The name of the documents to return. If you do not specify this parameter, the results are not filtered by name. | doc |
| PageNumber | integer | No | The number of the page to return. The value starts from 1. Default value: 1. | 1 |
| PageSize | integer | No | The number of documents to return on each page. Maximum value: 10. | 10 |
| WorkspaceId | string | Yes | The ID of the workspace to which the knowledge base belongs. For more information, see Workspaces. | llm-3z7uw7fwz0vexxxx |
| EnableNameLike | string | No | Specifies whether to perform a fuzzy search based on the document name. This parameter is used with the DocumentName parameter. Valid values: - true: Performs a fuzzy search based on the document name. - false: Performs an exact match based on the document name. Default value: false. | false |
Response elements
| Parameter | Type | Description | Example |
|---|---|---|---|
| object | Response schema | ||
| RequestId | string | The ID of the request. | 35A267BF-xxxx-54DB-8394-AA3B0742D833 |
| Code | string | The error code. | InvalidParameter |
| Message | string | The error message. | Required parameter(%s) missing or invalid, please check the request parameters. |
| Success | boolean | Indicates whether the request was successful. Valid values: - true: The request was successful. - false: The request failed. | true |
| Data | object | The returned data. | |
| Documents | array | A list of documents in the knowledge base. The documents are sorted by import time in descending order. This order is the same as the order in the console. | |
| object | The document object. | ||
| Status | string | The import status of the document. Valid values: - INSERT_ERROR: The document failed to be imported. - RUNNING: The document is being imported. - DELETED: The document has been deleted. - FINISH: The document was imported successfully. | RUNNING |
| EnableHeaders | string | Indicates whether the table headers of Excel files in an unstructured knowledge base are concatenated. | true |
| OverlapSize | string | The overlap length of chunks. | 100 |
| Message | string | The error message that is returned if the document fails to be imported. | check fileUrlKey[file_path] / fileNameKey[null] / fileExtensionKey[file_extension] is invalid |
| Size | integer | The size of the document, in bytes. | 996764 |
| SourceId | string | The category ID. | cate_21a407a3372c4ba7aedc649709143f0cxxxxxxxx |
| GmtModified | integer | The time when the document was imported. This value is a Unix timestamp. | 1744856423000 |
| DocumentType | string | The format of the document. Valid values: pdf, docx, doc, txt, md, pptx, ppt, png, jpg, jpeg, bmp, gif, and EXCEL. | |
| ChunkMode | string | The custom chunking method. | DashSplitter |
| Code | string | The error code that is returned if the document fails to be imported. | 110002 |
| separator | string | The sentence separator. | " " |
| Name | string | The name of the document. | doc |
| ChunkSize | string | The length of a chunk, in characters. | 600 |
| Id | string | The document ID. | doc_c134aa2073204a5d936d870bf960f56axxxxxxxx |
| IndexId | string | The knowledge base ID. | 79c0alxxxx |
| TotalCount | integer | The total number of entries. | 2437 |
| PageNumber | integer | The returned page number. | 1 |
| PageSize | integer | The number of entries returned on each page. | 10 |
| Status | string | The HTTP status code. | 200 |
Examples
Success response
JSON format
HELPCODEESCAPE-json
{
"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",
"OverlapSize": "100",
"Message": "check fileUrlKey[file_path] / fileNameKey[null] / fileExtensionKey[file_extension] is invalid",
"Size": 996764,
"SourceId": "cate_21a407a3372c4ba7aedc649709143f0cxxxxxxxx\n",
"GmtModified": 1744856423000,
"DocumentType": "pdf",
"ChunkMode": "DashSplitter",
"Code": "110002",
"separator": "\" \"",
"Name": "doc\n",
"ChunkSize": "600",
"Id": "doc_c134aa2073204a5d936d870bf960f56axxxxxxxx\n"
}
],
"IndexId": "79c0alxxxx",
"TotalCount": 2437,
"PageNumber": 1,
"PageSize": 10
},
"Status": "200"
}Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.