Appearance
Introduction
Doppio API is composed of very similar render methods but each with key differences. So, here is a guide to help you get started and find the one you need !
Render modes
Doppio can return your document in 3 different ways: direct
, sync
and async
.
A Direct
route will return your document directly in response to your request. Simple and efficient.
A Sync
route will not respond with the document directly but with the URL which temporarily host it after the document has been rendered.
INFO
If you provided a presigned URL, the URL will be from your own S3 bucket. See here for more info on this feature.
An Async
route will respond to your request immediately, then handle your request and call the provided webhook when the render is completed. The document is also passed on via the host URL. See here for more info on the async workflow.
Document types
Doppio can render your document as an image or a PDF. Supported image formats are PNG, JPEG, JPG and WEBP.
Making a request
All requests follow the same principles : a POST
request to the base URL https://api.doppio.sh
with some common params in the body.
Part of the body can change depending on the render mode or the document type requested. A PDF
or Image
route will have respectively an optional pdf
or screenshot
parameter for additional specifications. Async
routes will need a webhook
parameter specified in the body (nested inside doppio
parameter).
Here is a summary of all available routes and their specificities.
Enpoint | Render mode | Document Type | Body |
---|---|---|---|
/v1/render/pdf/direct | Direct | Common params, PDF params | |
/v1/render/pdf/sync | Sync | Common params, PDF params | |
/v1/render/pdf/async | Async | Common params, PDF params, Async params | |
/v1/render/screenshot/direct | Direct | Image | Common params, Screenshot params |
/v1/render/screenshot/sync | Sync | Image | Common params, Screenshot params |
/v1/render/screenshot/async | Async | Image | Common params, Screenshot params, Async params |