Errors

API Error Codes

Scale's API uses the following HTTP codes:

Error CodeMeaning
200OK -- Everything worked as expected.
400Bad Request -- The request was unacceptable, often due to missing a required parameter.
401Unauthorized -- No valid API key provided.
402Not enabled -- Please contact [email protected] before creating this type of task.
404Not Found -- The requested resource doesn't exist.
409Conflict -- The provided idempotency key or unique_id is already in use for a different request.
429Too Many Requests -- Too many requests hit the API too quickly.
500Internal Server Error -- We had a problem with our server. Try again later.

Attachment Processing Errors

In the event of one or more task attachments having invalid data, the task callback will be invoked with an error response detailing the problems, and the task's status will be set to error. Additional detail about the error and failed attachments will be stored in the task response.

Example Error Formats

{
    "status_code": 400,
    "error": "Please include an attachment or attachments parameter."
}
// example task.response with failed attachment due to access issues
{
    "error": "One or more attachments could not be downloaded.", // reason for error
    "attachments": [
        {
            "statusCode": 403, // HTTP code received when fetching attachment
            "url": "http://example.com/kitten.png", // attachment URL
        }
    ]
}
// example task.response with failed attachment processing
{
    "error": "One or more attachments could not be downloaded.", // reason for error
    "frames": [ // frames which failed processing
        {
            "frame": 10, // frame #
            "message": "Invalid JSON Format: Unexpected end of JSON input",
            "attachment": {
                "statusCode": 200, // HTTP code received when fetching attachment
                "url": "http://example.com/lidar/frame10.json", // attachment URL
            }
        }
    ]
}