获取文档¶
GET /documents/¶
Use this operation to retrieve metadata about all available documents and Slack channels within the data sources.
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
page |
query | integer | Page's index | |
page_size |
query | integer | The maximum number of documents returned in a page |
Responses
200— Successful operation
示例请求¶
curl -X GET
"https://api.rememberizer.ai/api/v1/documents/?page=1&page_size=20&integration_type=google_drive"
-H "Authorization: Bearer YOUR_JWT_TOKEN"
Info
将 YOUR_JWT_TOKEN 替换为您的实际 JWT 令牌。
const getDocuments = async (page = 1, pageSize = 20, integrationType = 'google_drive') => {
const url = new URL('https://api.rememberizer.ai/api/v1/documents/');
url.searchParams.append('page', page);
url.searchParams.append('page_size', pageSize);
if (integrationType) {
url.searchParams.append('integration_type', integrationType);
}
const response = await fetch(url.toString(), {
method: 'GET',
headers: {
'Authorization': 'Bearer YOUR_JWT_TOKEN'
}
});
const data = await response.json();
console.log(data);
};
getDocuments();
Info
将 YOUR_JWT_TOKEN 替换为您的实际 JWT 令牌。
import requests
def get_documents(page=1, page_size=20, integration_type=None):
headers = {
"Authorization": "Bearer YOUR_JWT_TOKEN"
}
params = {
"page": page,
"page_size": page_size
}
if integration_type:
params["integration_type"] = integration_type
response = requests.get(
"https://api.rememberizer.ai/api/v1/documents/",
headers=headers,
params=params
)
data = response.json()
print(data)
get_documents(integration_type="google_drive")
Info
将 YOUR_JWT_TOKEN 替换为您的实际 JWT 令牌。
请求参数¶
| 参数 | 类型 | 描述 |
|---|---|---|
| page | 整数 | 分页的页码。默认值为 1。 |
| page_size | 整数 | 每页的项目数量。默认值为 10。 |
| integration_type | 字符串 | 按集成类型过滤文档。选项:google_drive, slack, dropbox, gmail, common_knowledge |
响应格式¶
{
"count": 257,
"next": "https://api.rememberizer.ai/api/v1/documents/?page=2&page_size=20&integration_type=google_drive",
"previous": null,
"results": [
{
"document_id": "1aBcD2efGhIjK3lMnOpQrStUvWxYz",
"name": "项目提案.docx",
"type": "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
"path": "/Documents/Projects/Proposal.docx",
"url": "https://drive.google.com/file/d/1aBcD2efGhIjK3lMnOpQrStUvWxYz/view",
"id": 12345,
"integration_type": "google_drive",
"source": "user@example.com",
"status": "已索引",
"indexed_on": "2023-06-15T10:30:00Z",
"size": 250000
},
// ... 更多文档
]
}
可用的集成类型¶
| 集成类型 | 描述 |
|---|---|
| google_drive | 来自 Google Drive 的文档 |
| slack | 来自 Slack 的消息和文件 |
| dropbox | 来自 Dropbox 的文件 |
| gmail | 来自 Gmail 的电子邮件 |
| common_knowledge | 公开知识来源 |
此端点从您连接的数据源中检索文档列表。您可以按集成类型进行过滤,以专注于特定来源。