Skip to content

ListFile

Lists detailed information for one or more documents in a specified category.

Operation description

  • A RAM user must obtain database permissions for Alibaba Cloud Model Studio and join a workspace before calling this API. The required permission is AliyunBailianDataFullAccess, which includes the `sfm:ListFile` permission. An Alibaba Cloud account can call this API directly without authorization. To call this API, use the latest version of the Alibaba Cloud Model Studio SDK.

  • To perform a paged query, use the MaxResults parameter to specify the number of items to return on each page. The response returns a NextToken. To retrieve the next page of results, include the NextToken from the previous response in your next request. If the response does not return a NextToken, all results have been returned.

  • This API operation is idempotent.

Throttling Frequent calls to this API are throttled. Do not call this operation more than 5 times per second. If a call is throttled, retry the call 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.

ActionAccess levelResource typeCondition keyDependent action
sfm:ListFilelist*All Resource*NoneNone

Request syntax

HELPCODEESCAPE-plaintext
GET /{WorkspaceId}/datacenter/files HTTP/1.1

Request parameters

ParameterTypeRequiredDescriptionExample
WorkspaceIdstringYesThe ID of the workspace where the category resides. For more information, see How to use workspaces.llm-3shx2gu255oqxxxx
CategoryIdstringYesThe ID of the category. This is the `CategoryId` returned by the AddCategory operation. You can also obtain the ID on the Unstructured Data tab of the Application Data page by clicking the ID icon next to the category name.cate_cdd11b1b79a74e8bbd675c356a91ee35xxxxxxxx
NextTokenstringNoThe token that is used to retrieve the next page of results. Set this parameter to the `NextToken` value that is returned in the previous call.AAAAAdH70eOCSCKtacdomNzak4U=
MaxResultsintegerNoThe number of entries to return on each page. Valid values: 1 to 200. Default value: If you do not set this parameter or set it to a value less than 1, the default value is 20. If you set it to a value greater than 200, the default value is 200.20
FileNamestringNoThe name of the file, excluding the extension. Only exact matches are supported. Fuzzy searches are not supported.product-overview

Response elements

ParameterTypeDescriptionExample
objectThe response object.
CodestringThe error code.success
DataobjectThe returned data.
FileListarrayA list of documents in the category.
objectThe document object.
CategoryIdstringThe ID of the category to which the document belongs.cate_cdd11b1b79a74e8bbd675c356a91ee35xxxxxxxx
CreateTimestringThe time when the document was added to Alibaba Cloud 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
FileIdstringThe ID of the document. This is the `FileId` returned by the AddFile operation. You can also obtain the ID by clicking the icon next to the document name on the Application Data page.file_5ff599b3455a45db8c41b0054b361518_xxxxxxxx
FileNamestringThe name of the document.XXXproduct-overview.pdf
FileTypestringThe format of the document. Valid values: pdf, docx, doc, txt, md, pptx, ppt, xlsx, xls, html, png, jpg, jpeg, bmp, and gif.docx
ParserstringThe document parser. Valid values: - DASHSCOPE_DOCMIND: Alibaba Cloud Document Mind.DASHSCOPE_DOCMIND
SizeInBytesintegerThe size of the document in bytes.512
StatusstringThe parsing status of the document. Valid values: - INIT: The document is being initialized and is waiting to be scheduled. - PARSING: The document is being parsed. - PARSE_SUCCESS: The document is parsed. - PARSE_FAILED: The document failed to be parsed.PARSE_SUCCESS
TagsarrayA list of tags that are added to the document. You can associate multiple tags with a document.
stringThe tag of the document.product-overview
HasNextbooleanIndicates whether a next page of results exists. Valid values: - true: Yes. - false: No.true
MaxResultsintegerThe number of entries returned on each page.20
NextTokenstringThe token that is used to retrieve the next page of results.4jzbJk9J6lNeuXD9hP0viA==
TotalCountintegerThe total number of entries returned.48
MessagestringThe error message.Requests throttling triggered.
RequestIdstringThe ID of the request.8F97A63B-xxxx-527F-9D6E-467B6A7E8CF1
StatusstringThe HTTP status code.200
SuccessbooleanIndicates whether the request was successful. Valid values: - true: The request was successful. - false: The request failed.true

Examples

Success response

JSON format

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

Mirror of Alibaba Cloud Model Studio docs for reference and RAG. Not affiliated with Alibaba Cloud.