Skip to main content

GetFilterDocumentList

This operation retrieves a list of documents. You can filter documents by metadata or use paging.

Operation description

Prerequisites You have activated Alibaba Cloud Model Studio and the Tongyi Dianjin service. Obtain the workspaceId: get the workspace identity.

Try it now

You can run this API directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After a successful run, OpenAPI Explorer can automatically generate SDK code examples. Debug

RAM authorization

The following table lists the authorization information for this API. You can use the Action element of RAM permission policy statements to grant RAM users or RAM roles the permission to call this API. Details:
  • Action: the specific permission point.
  • Access level: the access level of each operation. Valid values: Write, Read, or List.
  • Resource type: the resource types that support authorization for the operation. Details:
    • For required resource types, an asterisk (*) is prefixed.
    • For operations that do not support resource-level authorization, All resources is used.
  • Condition key: the condition keys defined by the cloud service itself.
  • Dependent action: the other permissions required to successfully perform the operation. The caller must have the permissions of all dependent actions for the operation to succeed.
ActionAccess levelResource typeCondition keyDependent action
dianjin:GetFilterDocumentListnone
*All resources
*
    None
None

Request syntax

POST /{workspaceId}/api/library/filterDocument HTTP/1.1

Request parameters

ParameterTypeRequiredDescriptionExample
workspaceIdstringYes

Path parameter, workspace ID

llm-xxxxx
bodyobjectNo

Request body.

andarray<object>No

AND expression used to filter documents/document chunks

andobjectNo

A series of constraints in triplet format, joined by AND

boostfloatNo

The weight of the value in the text retrieval engine. Default is 1.

1
keystringNo

The metadata key in the document library

company
operatorstringNo

Relationship between the value stored under the document library metadata key and the input value

  • eq: the value stored under the document library metadata key = the input value
  • contains: the value list stored under the document library metadata key "contains" the input value
eq
valuestringNo

The input metadata value

alibaba
docIdListarrayNo

List of document IDs used to filter documents/document chunks

docIdListstringNo

Document ID

3553835752369972270
libraryIdstringYes

Document library ID used to filter documents/document chunks

cjshcxxxx
orarray<object>No

OR expression used to filter documents/document chunks.

orobjectNo

A series of constraints in triplet format, joined by OR

boostfloatNo

The weight of the value in the text retrieval engine. Default is 1.

1
keystringNo

The metadata key in the document library

company
operatorstringNo

Relationship between the value stored under the document library metadata key and the input value

  • eq: the value stored under the document library metadata key = the input value
  • contains: the value list stored under the document library metadata key "contains" the input value
contains
valuestringNo

The input metadata value

alibaba
pageintegerNo

Page number, used for pagination

1
pageSizeintegerNo

Page size, used for pagination

10
statusarrayNo

List of document statuses, used to filter documents.

Document parsing status list,

Status codes: WaitRefresh, InQueue, FetchingData, Embedding, Completed, FormatError, Error

  • Completed: available. Document parsing completed.
  • Error: unavailable. Document parsing error.
  • FormatError: file format error. For example, when a file is encrypted or incomplete, you need to re-upload a file in the correct format.
  • InQueue: pending. The document is waiting to be parsed.
  • Parsed: parsing completed.
  • Other statuses: internal system statuses. WaitRefresh indicates that the task is scheduled, FetchingData indicates that parsing is in progress, and Embedding indicates that index building is in progress.
statustringNo

Document status, used to filter documents.

Completed

Response elements

ElementTypeDescriptionExample
object

Returned data

costlong

Time consumed

null
dataobject

Response data

currentPagelong

Current page number

1
pageSizelong

Number of records per page

10
recordsarray<object>

Records

recordobject

Data

docIdstring

Document ID

29368126816
documentMetaobject

Document metadata

{"a": "1"}
fileTypestring

Document type

pdf
gmtCreatestring

Creation time

2024-01-01 00:00:00
gmtModifiedstring

Modification time

2024-01-01 00:00:00
libraryIdstring

The ID of the library to which the document belongs

sdfgsjdfg
statusCodestring

Document status (WaitRefresh: waiting for refresh, InQueue: pending, FetchingData: retrieving data, Embedding: processing document, Error: error, Completed: available, Null: unknown)

WaitRefresh
titlestring

Document title

Company document
urlstring

Document URL

null
totalPageslong

Total number of pages

10
totalRecordslong

Total number of records

100
dataTypestring

Data type

null
errCodestring

Error code

0
messagestring

Error message

ok
requestIdstring

Request ID

7ADF010C-FD89-569D-A079-2D4D5247E943
successboolean

Whether the request is successful

true
timestring

Timestamp

2024-01-01 00:00:00

Examples

Success response JSON format
{
  "cost": 0,
  "data": {
    "currentPage": 1,
    "pageSize": 10,
    "records": [
      {
        "docId": 29368126816,
        "documentMeta": {
          "a": 1
        },
        "fileType": "pdf",
        "gmtCreate": "2024-01-01 00:00:00",
        "gmtModified": "2024-01-01 00:00:00",
        "libraryId": "sdfgsjdfg",
        "statusCode": "WaitRefresh",
        "title": "公司文档",
        "url": null
      }
    ],
    "totalPages": 10,
    "totalRecords": 100
  },
  "dataType": null,
  "errCode": 0,
  "message": "ok",
  "requestId": "7ADF010C-FD89-569D-A079-2D4D5247E943",
  "success": true,
  "time": "2024-01-01 00:00:00"
}

Error codes

Visit the Error Center for more error codes.