Lấy nội dung tài liệu
Returns the content of the document with the specified ID, along with the index of the latest retrieved chunk. Each call fetches up to 20 chunks. To get more, use the end_chunk value from the response as the start_chunk for the next call.
Path parameters
document_idintegerRequired
The ID of the document to retrieve contents for.
Query parameters
start_chunkintegerOptional
Indicate the starting chunk that you want to retrieve. If not specified, the default value is 0.
end_chunkintegerOptional
Indicate the ending chunk that you want to retrieve. If not specified, the default value is start_chunk + 20.
Responses
200
Content of the document and index of the latest retrieved chunk.
application/json
404
Document not found.
500
Internal server error.
get
/documents/{document_id}/contents/Ví dụ Yêu cầu
curl -X GET \
"https://api.rememberizer.ai/api/v1/documents/12345/contents/?start_chunk=0&end_chunk=20" \
-H "Authorization: Bearer YOUR_JWT_TOKEN"const getDocumentContents = async (documentId, startChunk = 0, endChunk = 20) => {
const url = new URL(`https://api.rememberizer.ai/api/v1/documents/${documentId}/contents/`);
url.searchParams.append('start_chunk', startChunk);
url.searchParams.append('end_chunk', endChunk);
const response = await fetch(url.toString(), {
method: 'GET',
headers: {
'Authorization': 'Bearer YOUR_JWT_TOKEN'
}
});
const data = await response.json();
console.log(data);
// Nếu có nhiều chunk hơn, bạn có thể lấy chúng
if (data.end_chunk < totalChunks) {
// Lấy tập hợp chunk tiếp theo
await getDocumentContents(documentId, data.end_chunk, data.end_chunk + 20);
}
};
getDocumentContents(12345);Tham số Đường dẫn
Tham số
Loại
Mô tả
Tham số truy vấn
Tham số
Loại
Mô tả
Định dạng Phản hồi
Phản hồi lỗi
Mã trạng thái
Mô tả
Phân trang cho Tài liệu Lớn
Last updated