ListFile

更新时间:
复制 MD 格式

Retrieves the details of one or more documents in a specified category.

Operation description

  • Resource Access Management (RAM) users must first obtain API permissions for Alibaba Cloud Model Studio (requires AliyunBailianDataFullAccess, which includes the sfm:ListFile permission), and join a workspace before invoking this operation. Alibaba Cloud accounts can invoke this operation directly without authorization. Invoke this operation by using the latest Alibaba Cloud Model Studio SDK.

  • When performing paging for the first page, only set MaxResults to limit the number of entries returned. The NextToken in the response serves as the credential for querying subsequent pages. When querying subsequent pages, set the NextToken parameter to the NextToken value obtained from the previous response as the query credential (if NextToken is empty, all results have been returned and no further requests are needed), and set MaxResults to limit the number of entries returned.

  • This operation is idempotent.

Rate limit: This operation is throttled if called too frequently. Do not exceed 5 calls per second. If throttled, retry 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 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:ListFile

list

*All Resource

*

None None

Request syntax

GET /{WorkspaceId}/datacenter/files HTTP/1.1

Path Parameters

Parameter

Type

Required

Description

Example

WorkspaceId

string

Yes

The workspace ID to which the category belongs. For information about how to obtain the workspace ID, see How to use a workspace.

llm-3shx2gu255oqxxxx

Request parameters

Parameter

Type

Required

Description

Example

CategoryId

string

Yes

The category ID, which is the CategoryId returned by the AddCategory operation. You can also obtain it on the Application Data - Files tab by clicking the ID icon next to the category name.

cate_cdd11b1b79a74e8bbd675c356a91ee35xxxxxxxx

NextToken

string

No

The pagination token. Set this to the NextToken value returned by the previous API call.

AAAAAdH70eOCSCKtacdomNzak4U=

MaxResults

integer

No

The number of entries per page for paging. Valid values: 1 to 200.

Default value: If the value is not set or is less than 1, the default value is 20. If the value is greater than 200, the default value is 200.

20

FileName

string

No

The file name (without extension). Only exact match is supported. Fuzzy search is not supported.

product-overview

FileIds

array

No

The list of file IDs to query. A maximum of 20 files can be queried per request.

string

No

The file ID.

file_xxxx

Response elements

Element

Type

Description

Example

object

Schema of Response

Code

string

The error code.

success

Data

object

The data field returned by the operation.

FileList

array<object>

The list of files in the category.

object

The file object.

CategoryId

string

The ID of the category to which the file belongs.

cate_cdd11b1b79a74e8bbd675c356a91ee35xxxxxxxx

CreateTime

string

The time when the file was added to 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 file ID. This is the FileId returned by the AddFile operation. You can also go to the Application Data page and click the icon next to a file name to obtain the file ID.

file_5ff599b3455a45db8c41b0054b361518_xxxxxxxx

FileName

string

The file name.

product-overview.pdf

FileType

string

The file format. 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 value:

  • DASHSCOPE_DOCMIND: Alibaba Cloud Document Intelligence.

DASHSCOPE_DOCMIND

SizeInBytes

integer

The file size in bytes.

512

Status

string

The parsing status of the file. Valid values:

  • INIT: The file is being initialized and is waiting for parsing.

  • PARSING: The file is being parsed.

  • PARSE_SUCCESS: The file is parsed.

  • PARSE_FAILED: The file fails to be parsed.

PARSE_SUCCESS

ParseErrorMessage

string

Tags

array

The list of tags that are associated with the file. A file can be associated with multiple tags.

string

The tag of the file.

tag-A

HasNext

boolean

Indicates whether there is a next page of category data that matches the query conditions. Valid values:

  • true: Yes.

  • false: No.

true

MaxResults

integer

The number of entries per page for paging.

20

NextToken

string

The pagination token returned by this call.

4jzbJk9J6lNeuXD9hP0viA==

TotalCount

integer

The total number of entries in the returned results.

48

Message

string

The error message.

Requests throttling triggered.

RequestId

string

The request ID.

8F97A63B-xxxx-527F-9D6E-467B6A7E8CF1

Status

string

The status code returned by the operation.

200

Success

boolean

Indicates whether the operation was successful. Valid values:

  • true: Successful.

  • false: Failed.

true

Examples

Success response

JSON format

{
  "Code": "success",
  "Data": {
    "FileList": [
      {
        "CategoryId": "cate_cdd11b1b79a74e8bbd675c356a91ee35xxxxxxxx",
        "CreateTime": "2024-09-09 11:03:35",
        "FileId": "file_5ff599b3455a45db8c41b0054b361518_xxxxxxxx",
        "FileName": "product-overview.pdf",
        "FileType": "docx",
        "Parser": "DASHSCOPE_DOCMIND",
        "SizeInBytes": 512,
        "Status": "PARSE_SUCCESS",
        "Tags": [
          "tag-A"
        ]
      }
    ],
    "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.