Appearance
ListIndexDocuments
Queries the details of one or more documents in a specified knowledge base.
Operation description
- Before you call this operation, make sure that your knowledge base is created and is not deleted. That is, the primary key ID of the knowledge base
IndexIdis valid. - This interface is idempotent.
Debugging
You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples. Debug
Authorization information
The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:
- Operation: the value that you can use in the Action element to specify the operation on a resource.
- Access level: the access level of each operation. The levels are read, write, and list.
- Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
- For mandatory resource types, indicate with a prefix of * .
- If the permissions cannot be granted at the resource level,
All Resourcesis used in the Resource type column of the operation.
- Condition Key: the condition key that is defined by the cloud service.
- Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
| Operation | Access level | Resource type | Condition key | Associated operation |
|---|---|---|---|---|
| sfm:ListIndexFiles | list | * All Resources * | none | none |
Request syntax
GET /{WorkspaceId}/index/list_index_documents HTTP/1.1Request parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
| IndexId | string | Yes | The primary key ID of the knowledge base, which is the Data.Id parameter returned by the CreateIndex operation. | 79c0aly8zw |
| DocumentStatus | string | No | The import status of the documents to be queried. Valid values: - INSERT_ERROR - RUNNING - DELETED - FINISH The default value is null, which means the import status is not used to filter the results. | FINISH |
| DocumentName | string | No | The names of the queried documents. The default value is null, which means the names are not used to filter the results. | |
| PageNumber | integer | No | The page numbers of the pages to return. Pages start from page 1. Default value: 1. | 1 |
| PageSize | integer | No | The number of documents displayed on each page. No maximum value. Default value: 10. | 10 |
| WorkspaceId | string | Yes | The ID of the workspace to which the knowledge base belongs. To view the workspace ID, you can click the Workspace Details icon in the upper-left corner on the homepage of the console. | ws_3Nt27MYcoK191ISp |
Response parameters
| Parameter | Type | Description | Example |
|---|---|---|---|
| object | Schema of Response | ||
| Code | string | HTTP status code | InvalidParameter |
| Data | object | The returned data. | |
| Documents | array | The list of documents in the knowledge base. | |
| rows | object | The document object. | |
| Code | string | The error status code of document import. | 110002 |
| DocumentType | string | The format of the document. Valid values: pdf, docx, doc, txt, md, pptx, ppt, and EXCEL. | |
| Id | string | The primary key ID of the document. | doc_c134aa2073204a5d936d870bf960f56a10024701 |
| Message | string | The error message of document import. | check fileUrlKey[file_path] / fileNameKey[null] / fileExtensionKey[file_extension] is invalid |
| Name | string | The name of the document. | |
| Size | integer | The size of the document. Unit: bytes. | 996764 |
| SourceId | string | For unstructured knowledge base, this parameter is the category ID. To view the category ID, you can click the ID icon next to the category name on the Unstructured Data tab of the Data Management page. For structured knowledge base, this parameter is the data table ID. To view the table ID, you can click the ID icon next to the table name on the Structured Data tab of the Data Management page. | cate_21a407a3372c4ba7aedc649709143f0c10021401 |
| Status | string | The import status of the document. Valid values: - INSERT_ERROR - RUNNING - DELETED - FINISH | RUNNING |
| IndexId | string | The primary key ID of the knowledge base. | pno97tn8iu |
| PageNumber | integer | The specified page number. | 1 |
| PageSize | integer | The specified number of documents on each page. | 10 |
| TotalCount | long | The total number of documents returned. | 2437 |
| Message | string | The error message. | Required parameter(%s) missing or invalid, please check the request parameters. |
| RequestId | string | The request ID. | 35A267BF-xxxx-54DB-8394-AA3B0742D833 |
| Status | string | The status code. | 200 |
| Success | boolean | Indications whether the API call is successful. Valid values: - true - false | true |
Examples
Sample success responses
JSONformat
{
"Code": "InvalidParameter",
"Data": {
"Documents": [
{
"Code": 110002,
"DocumentType": "pdf",
"Id": "doc_c134aa2073204a5d936d870bf960f56a10024701",
"Message": "check fileUrlKey[file_path] / fileNameKey[null] / fileExtensionKey[file_extension] is invalid",
"Name": "",
"Size": 996764,
"SourceId": "cate_21a407a3372c4ba7aedc649709143f0c10021401",
"Status": "RUNNING"
}
],
"IndexId": "pno97tn8iu",
"PageNumber": 1,
"PageSize": 10,
"TotalCount": 2437
},
"Message": "Required parameter(%s) missing or invalid, please check the request parameters.",
"RequestId": "35A267BF-xxxx-54DB-8394-AA3B0742D833",
"Status": 200,
"Success": true
}Error codes
For a list of error codes, visit the Service error codes.