Returns extracted textual information for the given document.
The documents pipeline extracts up to 1MiB of textual information from each processed document.
The search and list endpoints truncate the textual content of each document, in order to reduce the size
of the returned payload. If you want the whole text for a document, you can use this endpoint.
The accept
request header MUST be set to text/plain
. Other values will
give an HTTP 406 error.
OK
The response for a failed request.
content = client.documents.retrieve_content(id=123) from pathlib import Path with Path("my_file.txt").open("wb") as buffer: client.documents.retrieve_content_buffer(id=123, buffer=buffer)
{- "error": {
- "code": 401,
- "message": "Could not authenticate.",
- "missing": [
- { }
], - "duplicated": [
- { }
]
}
}