Get Doc List
Get Doc List
Get a list of knowledge documents in the knowledge base within the Agent.
Request Method
GET
Request URL
https://api-${endpoint}.gptbots.ai/v1/bot/doc/query/page
Request Authentication
See Overview for authentication details.
Request
Request Example
curl -X GET 'https://api.gptbots.ai/v1/bot/doc/query/page?page=1&page_size=10&knowledge_base_id=67457fea6f658672d6482542' \
-H 'Authorization: Bearer ${API Key}'
curl -X GET 'https://api.gptbots.ai/v1/bot/doc/query/page?page=1&page_size=10&knowledge_base_id=67457fea6f658672d6482542' \
-H 'Authorization: Bearer ${API Key}'
บล็อกโค้ดนี้ในหน้าต่างลอย
Request Header
Field | Type | Description |
---|---|---|
Authorization | Bearer ${API Key} | Use Authorization: Bearer ${API Key} for authentication. Get API key from API Key page. |
Request Parameters
Field | Type | Required | Description |
---|---|---|---|
knowledge_base_id | String | Yes | The ID of the knowledge base. |
page | Integer | Yes | Page number, starting from 1. |
page_size | Integer | Yes | Number of documents per page. Fill in the range 10-100. |
Response
Response Example
{
"list": [
{
"id": "xxxxxx",
"name": "My Doc",
"format": "pdf",
"source_url": "https://gptbots.ai/article_1.pdf",
"status": "ACTIVE",
"chunk": 100,
"token": 1000000,
"char_count": 10000000,
"create_time": 1699843200,
"update_time": 1699843200,
"creator_id": "xxxxxx",
"creator_email": "johnlee@gptbots.ai"
},
{
"id": "xxxxxx",
"name": "My Doc 2",
"format": "txt",
"source_url": "https://gptbots.ai/article_2.html",
"status": "ACTIVE",
"chunk": 100,
"token": 1000000,
"char_count": 10000000,
"create_time": 1699843200,
"update_time": 1699843200,
"creator_id": "xxxxxx",
"creator_email": "johnlee@gptbots.ai"
}
],
"total": 100
}
{
"list": [
{
"id": "xxxxxx",
"name": "My Doc",
"format": "pdf",
"source_url": "https://gptbots.ai/article_1.pdf",
"status": "ACTIVE",
"chunk": 100,
"token": 1000000,
"char_count": 10000000,
"create_time": 1699843200,
"update_time": 1699843200,
"creator_id": "xxxxxx",
"creator_email": "johnlee@gptbots.ai"
},
{
"id": "xxxxxx",
"name": "My Doc 2",
"format": "txt",
"source_url": "https://gptbots.ai/article_2.html",
"status": "ACTIVE",
"chunk": 100,
"token": 1000000,
"char_count": 10000000,
"create_time": 1699843200,
"update_time": 1699843200,
"creator_id": "xxxxxx",
"creator_email": "johnlee@gptbots.ai"
}
],
"total": 100
}
บล็อกโค้ดนี้ในหน้าต่างลอย
Success Response
Field Name | Type | Description |
---|---|---|
list | Array<Object> | Document list. |
id | String | Document ID. |
name | String | Document name. |
format | String | Document format. |
source_url | String | Document source URL. |
status | String | Document status. |
chunk | Integer | Number of knowledge chunks in the document. |
token | Integer | Number of tokens in the document. |
char_count | Integer | Number of characters in the document. |
create_time | Long | Document creation time, timestamp. |
update_time | Long | Document update time, timestamp. |
creator_id | String | Creator ID of the document. |
creator_email | String | Creator's email of the document. |
total | Integer | Total number of documents found. |
Failure Response
Field | Type | Description |
---|---|---|
code | Int | Error code. |
message | String | Error details. |