Error Codes
Should you send a bad request you may receive an HTTP error in response to your API query to generate a screenshot. The errors are self-explanatory in nature, but are also documented here as an example of what you can expect.
Quota Reached
Should you have reached your Quota you will receive an HTTP 402 response with the following content:
{
"message": "You have reached your quota."
}
Validation Errors
Requests are validated to ensure they meet the required fields, that your URL is valid, or that they are within the limitations (e.g. delay can be between 0 and 10000).
Errors are returned in the "field": "errors" format, and below is an example for an invalid delay:
curl -H "Accept: application/json" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
"https://screendot.io/api/standard?url=https://www.google.com&delay=999999"
{
"delay": ["The delay must not be greater than 10000."]
}
You may also receive multiple errors, as shown below:
curl -H "Accept: application/json" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
"https://screendot.io/api/standard?url=bad://url&delay=999999"
{
"url":["The url must be a valid URL."],
"delay": ["The delay must not be greater than 10000."]
}
Field Restrictions
Field | Rules |
---|---|
url | Valid http or https URL |
delay | Optional, between 0 and 10000 |
browserWidth | Optional, between 50 and 4096 |
browserHeight | Optional, between 50 and 10000 |
width | Optional, between 50 and 4096 |
width | Optional, between 50 and 10000 |
format | Optional, one of "jpg", "gif", "webp", "png" |
refresh | Optional, boolean |
response | Optional, one of "json", "image", "url" |