Recuperar contenidos de documentos
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.
The ID of the document to retrieve contents for.
Indicate the starting chunk that you want to retrieve. If not specified, the default value is 0.
Indicate the ending chunk that you want to retrieve. If not specified, the default value is start_chunk + 20.
Content of the document and index of the latest retrieved chunk.
Document not found.
Internal server error.
Ejemplos de Solicitudes
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);
// Si hay más fragmentos, puede obtenerlos
if (data.end_chunk < totalChunks) {
// Obtener el siguiente conjunto de fragmentos
await getDocumentContents(documentId, data.end_chunk, data.end_chunk + 20);
}
};
getDocumentContents(12345);Parámetros de Ruta
document_id
entero
Requerido. El ID del documento para el cual recuperar contenidos.
Parámetros de Consulta
start_chunk
entero
El índice del fragmento inicial. El valor predeterminado es 0.
end_chunk
entero
El índice del fragmento final. El valor predeterminado es start_chunk + 20.
Formato de Respuesta
Respuestas de Error
404
Documento no encontrado
500
Error interno del servidor
Paginación para Documentos Grandes
Para documentos grandes, el contenido se divide en fragmentos. Puedes recuperar el documento completo haciendo múltiples solicitudes:
Haz una solicitud inicial con
start_chunk=0Usa el valor
end_chunkdevuelto comostart_chunkpara la siguiente solicitudContinúa hasta que hayas recuperado todos los fragmentos
Este endpoint devuelve el contenido de texto sin procesar de un documento, lo que te permite acceder a toda la información para un procesamiento o análisis detallado.
Last updated