ListIndexFileDetails

Updated at:
Copy as MD

Retrieves the files in a specified knowledge base along with their details.

Operation description

  • Resource Access Management (RAM) users must first obtain API permissions for Alibaba Cloud Model Studio (AliyunBailianDataFullAccess is required, which includes the sfm:ListIndexFiles permission), before invoking this operation. Alibaba Cloud accounts can invoke this operation directly without authorization. Use the latest Alibaba Cloud Model Studio SDK to invoke this operation.

  • Before invoking this operation, make sure that your knowledge base has been created and has not been deleted (that is, the knowledge base ID IndexId is valid).

  • This operation has idempotence.

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 Action element 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 Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element 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: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 ID of the workspace 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 Data.Id returned by the CreateIndex operation.

79c0alxxxx

DocumentStatus

string

No

Filters the returned file list by file import status. Valid values:

  • INSERT_ERROR: Failed to import to the index.

  • RUNNING: Index building in progress.

  • DELETED: Deleted.

  • FINISH: Index building succeeded.

  • PARSE_FAILED: Parsing failed.

  • DOC_PARSING: Parsing in progress.

Default value: empty, which means no filtering by file import status.

Valid values:

  • INSERT_ERROR :

    File import failed.

  • RUNNING :

    File import in progress.

  • DELETED :

    File deleted.

  • FINISH :

    File import succeeded.

FINISH

DocumentName

string

No

Filters the returned file details list by file name. Default value: empty, which means no filtering by file name.

翻译平台运维文档

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 for paging. Maximum value: 10.

10

EnableNameLike

string

No

Specifies whether to enable fuzzy matching for file names. This parameter is used together with the DocumentName parameter. Valid values:

  • true: Performs fuzzy matching on the returned file list based on the file name.

  • false: Performs exact matching on the returned file list based on the file name.

Default value: false.

Valid values:

  • true :

    enabled.

  • false :

    disabled.

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: Successful.

  • false: Failed.

true

Data

object

The data field returned by the operation.

Documents

array<object>

The list of files in the knowledge base, sorted by file import time in descending order (consistent with the console).

object

The file object.

Status

string

The file import status. Valid values:

  • INSERT_ERROR: File import failed.

  • RUNNING: File import in progress.

  • DELETED: File deleted.

  • FINISH: File import succeeded.

RUNNING

EnableHeaders

string

Indicates whether Excel file headers support concatenation.

true

OverlapSize

string

The overlap length between segments.

100

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

GmtModified

integer

The time when the file was imported to the knowledge base, in UNIX timestamp format.

1744856423000

DocumentType

string

The file format type. Valid values: pdf, docx, doc, txt, md, pptx, ppt, png, jpg, jpeg, bmp, gif, and EXCEL.

pdf

ChunkMode

string

The custom chunking mode.

DashSplitter

Code

string

The file import error status code.

110002

separator

string

The sentence separator.

" "

Name

string

The file name.

翻译平台运维文档

ChunkSize

string

The segment length, which is the number of characters in a text chunk.

600

Id

string

The file ID.

doc_c134aa2073204a5d936d870bf960f56axxxxxxxx

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 entries 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",
        "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": "翻译平台运维文档\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.