Skip to main content

GetDocumentList

Retrieves a list of documents from a document library. This operation supports paged queries and filtering by document status.

Operation description

Prerequisites
  • Alibaba Cloud Model Studio and the Tongyi Gold service are activated.
  • 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:GetDocumentListget
*All resources
*
    None
None

Request syntax

GET /{workspaceId}/api/library/listDocument HTTP/1.1

Request parameters

ParameterTypeRequiredDescriptionExample
workspaceIdstringYes

Path parameter, workspace ID.

llm-xxxx
pageintegerNo

Page number

1
pageSizeintegerNo

Page size

10
statusstringNo

Document status

Soon to be available
libraryIdstringYes

Document library ID

3akzl28vap

Response elements

ElementTypeDescriptionExample
object

The returned result.

costlong

Time consumed

null
dataobject

Response data

currentPagelong

Current page number (paging parameter).

1
pageSizelong

Page size (paging parameter).

10
recordsarray<object>

Records

recordobject
docIdstring

Document ID

8326748346
documentMetaobject

Document metadata

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.

skjdhshbv
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

test
urlstring

The document URL (this field will be deprecated). The value is empty. To get the document URL, use the GetDocumentUrl operation.

null
totalPageslong

Total number of pages (paging parameter).

10
totalRecordslong

Total number of records.

100
dataTypestring

Data type

null
errCodestring

Error code

0
messagestring

Error message

ok
requestIdstring

Request ID

5E3FBAF1-17AF-53B7-AF0A-CDCEEB6DE658
successboolean

Whether the request is successful

true
timestring

Timestamp

2024-04-24 11:54:34

Examples

Success response JSON format
{
  "cost": 0,
  "data": {
    "currentPage": 1,
    "pageSize": 10,
    "records": [
      {
        "docId": 8326748346,
        "documentMeta": {
          "test": "test",
          "test2": 1
        },
        "fileType": "pdf",
        "gmtCreate": "2024-01-01 00:00:00",
        "gmtModified": "2024-01-01 00:00:00",
        "libraryId": "skjdhshbv",
        "statusCode": "WaitRefresh",
        "title": "test",
        "url": null
      }
    ],
    "totalPages": 10,
    "totalRecords": 100
  },
  "dataType": null,
  "errCode": 0,
  "message": "ok",
  "requestId": "5E3FBAF1-17AF-53B7-AF0A-CDCEEB6DE658",
  "success": true,
  "time": "2024-04-24 11:54:34"
}

Error codes

Visit the Error Center for more error codes.