Appearance
What to expect from us
Doppio uses standard HTTP response codes so our API responses stay easy to understand. The table below explains what each status code means:
| Status code | Meaning | Description |
|---|---|---|
| 200 | OK | The request succeeded. |
| 400 | Bad Request | The server cannot or will not process the request because of an apparent client error, such as malformed request syntax or invalid parameters. |
| 401 | Unauthorized | No valid API key provided. |
| 403 | Forbidden | Your subscription is inactive, or it does not include the requested functionality. |
| 404 | Not Found | The requested resource does not exist. |
| 408 | Request Timeout | The request was not received in full in time, for example over a very slow connection. |
| 413 | Payload Too Large | The request body is too large. Contact support if you need help. |
| 422 | Unprocessable Entity | The total number of requests exceeds your subscription limits. |
| 429 | Too Many Requests | Too many requests were sent to the server in a short period of time. |
| 500 | Internal Server Error | An error occurred on Doppio's server, or a /sync or /direct render failed. |
| 502, 503 | Bad Gateway, Service Unavailable | Doppio's server is temporarily unreachable. Retry later. |
| 504 | Gateway Timeout | The response took longer than our network layer allows, for example a very long synchronous render. For long renders, prefer an async render. |
Error Response
When our API rejects a request with a 4xx status code, it returns a JSON payload such as:
json
{
"statusCode": 403,
"message": "Current subscription does not allow async requests.",
"error": "Forbidden",
"code": "ASYNC_NOT_ALLOWED"
}| Field | Description |
|---|---|
statusCode | The status code, as in the table above. |
message | Details about the error: a string, or an array of strings for validation errors. Messages are meant for humans and may change, so don't parse them. |
error | The meaning of the status code, as in the table above. Some errors, such as 413 and 429, don't include it. |
code | A stable code, only in the errors listed in Error Codes. |
Here are a few examples of messages you might receive for a Bad Request error:
page.goto.url must be an URL addresspage.goto and setContent are mutually exclusiveExpected double-quoted property name in JSON at position 49 (line 1 column 50)
The body of other errors can differ. When a /sync or /direct render fails, the API answers 500 with a render response whose renderStatus is ERROR. The 408, 502, 503 and 504 statuses come from our network layer, not from the API, and have no JSON body: rely on the status code.
Error Codes
The errors below include a code. Unlike the message, the code of an error does not change: use it to handle the error in your integration.
| Code | Status code | Description |
|---|---|---|
INVALID_API_KEY | 401 | The API key is missing or does not belong to any organization. |
UNPAID_INVOICES | 403 | Your organization is blocked because of unpaid invoices. |
ASYNC_NOT_ALLOWED | 403 | The plan of your organization does not allow asynchronous renders. |
TEMPLATES_NOT_ALLOWED | 403 | The plan of your organization does not allow templates. |
TEMPLATE_NOT_FOUND | 404 | The template does not exist in your organization. |
MONTHLY_QUOTA_REACHED | 422 | Your organization has reached the monthly request limit of its plan. |
RATE_LIMIT_EXCEEDED | 429 | Your organization sends requests faster than its plan allows. |
Compatibility
Success responses and webhook payloads don't change. We may add new fields to error responses, and new codes. To keep your integration working:
- ignore unknown fields;
- handle unknown codes, for example by falling back on the status code;
- rely on
codeand the status code, not onmessage.