documents.get
documents.get(id: str) -> DocumentDescriptor (no description)
Parameters
Section titled “Parameters”| Name | Type | Required | Description |
|---|---|---|---|
id | str | required | The `document_id` returned by a prior `render.document` call. |
Returns
Section titled “Returns”DocumentDescriptor — a DocumentDescriptor refreshed with a new presigned_pdf_url (15-minute TTL).
Errors
Section titled “Errors”| Code | When |
|---|---|
DOCUMENT_NOT_FOUND | No stored document matches the supplied id. |
INVALID_API_KEY | The API key is malformed or revoked. |
INTERNAL_ERROR | The API returned 5xx. Retryable. |
Example
Section titled “Example”# Demonstrates: client.documents.get(id) — fetch a stored document.from poli_page import PoliPage
client = PoliPage()
document = client.documents.get("doc_abc123")
print( f"Document {document.document_id}: {document.page_count} pages, " f"created {document.created_at}")
# `presigned_pdf_url` has a 15-minute TTL. Call download_pdf() to fetch bytes# before it expires, or call documents.get(id) again to refresh.pdf = document.download_pdf()print(f"Downloaded {len(pdf)} bytes")