Skip to content

HTTP API

Get a page

GET
/v1/documents/{document_id}/pages/{page}
curl --request GET \
--url 'https://sergo.example.com/v1/documents/example/pages/1?format=png' \
--header 'Authorization: Bearer <token>'

One page as a PNG picture, or as a one-page PDF. Works for PDFs and for Office files with a PDF copy. The X-Page-Count header gives the number of pages.

404 page_view_pending while the PDF copy is being made, 404 no_page_view when the file has none, 422 page_out_of_range past the last page.

document_id
required
Document Id
string
page
required
Page

Page number, from 1

integer

Page number, from 1

format
Format

png for a picture, pdf for a one-page PDF

string
default: png

png for a picture, pdf for a one-page PDF

The page

X-Page-Count
integer

Pages in the document

Validation Error

Media typeapplication/json
RequestError
object
code
required
Code
string
Allowed value: invalid_request
message
required
Message

What was wrong, field by field

string

Example

{
"code": "invalid_request"
}