This topic describes the API used to query a document list. You can obtain the processing status of documents from the status field in the response.
Prerequisites
An API key for identity authentication is obtained. When you call the API operations of OpenSearch LLM-Based Conversational Search Edition, you must be authenticated. For more information, see Manage API keys. LLM is short for large language model.
An endpoint is obtained. When you call the API operations of OpenSearch LLM-Based Conversational Search Edition, you must specify an endpoint. For more information, see Obtain endpoints.
Operation information
Request method | Request protocol | Request data format |
GET | HTTP | JSON |
Request URL
{host}/v3/openapi/apps/[app_group_identity]/knowledge/documents{host}: the endpoint that is used to call the OpenSearch API. You can call the API over the Internet or a virtual private cloud (VPC). For more information, see Obtain endpoints.{app_group_identity}: the name of the application that you want to access. You can log on to the OpenSearch LLM-Based Conversational Search Edition console and view the application name of the corresponding instance on the Instance Management page.
Request parameters
Parameter | Type | Location | Required | Description |
id | string | Query | No | The ID of a document. |
title | string | Query | No | The title of the document. Fuzzy match is supported. |
category | string | Query | No | The category of the document. |
page_number | integer | Query | No | The page number. |
page_size | integer | Query | No | The number of entries per page. |
table_name | string | Query | No | The name of the table to query. If you leave this parameter empty, the default value main is used. |
Sample request body
{
"title": "test",
"category": "test",
"page_number": 1,
"page_size": "20"
}Response parameters
Parameter | Type | Description |
id | string | The primary key ID. |
title | string | The title of the document. |
score | float | The relevance-based score of the document. |
timestamp | integer | The timestamp of the document. |
status | string | The processing status of the document. Valid values:
|
Sample response body
[
{
"id": "5241",
"title": "Withdraw housing provident funds to purchase a self-owned house",
"score": 0,
"timestamp": 0,
"status": "ok"
},
{
"id": "5238",
"title": "Operation specifications for social security card business",
"score": 0,
"timestamp": 0,
"status": "ok"
},
{
"id": "5234",
"title": "Material submission specifications for deregistration of domestic branch companies",
"score": 0,
"timestamp": 0,
"status": "ok"
}
]