Appearance
Introduction
Doppio's API includes several render methods that work in similar ways, but each one has important differences. This guide will help you understand them and choose the one you need.
Render modes
Doppio can return your document in three different ways: direct, sync, and async.
A direct route returns the document directly in response to your request.
A sync route does not return the document directly. Instead, it returns a URL where the rendered document is temporarily hosted.
INFO
If you provide a presigned URL, the returned file URL will point to your own S3 bucket. See here for more information.
An async route responds immediately, then processes your request in the background and calls the provided webhook when the render is complete. The resulting document is still delivered through a hosted URL. See here for more information about 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 principle: send a POST request to the base URL https://api.doppio.sh with some common parameters in the body.
Part of the body changes depending on the render mode and the document type. A PDF route can include an optional pdf object, while an image route can include an optional screenshot object. Async routes also require a webhook parameter inside the doppio object.
Here is a summary of all available routes and what each one expects.
| Endpoint | 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 |