Scale
API Errors
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
Scale's API uses the following HTTP codes:
Error Code | Meaning |
---|---|
200 | OK -- Everything worked as expected. |
400 | Bad Request -- The request was unacceptable, often due to missing a required parameter. |
401 | Unauthorized -- No valid API key provided. |
402 | Not enabled -- Please contact [email protected] before creating this type of task. |
404 | Not Found -- The requested resource doesn't exist. |
409 | Conflict -- The provided idempotency key or |
429 | Too Many Requests -- Too many requests hit the API too quickly. |
500 | Internal Server Error -- We had a problem with our server. Try again later. |
Example Error Formats
These examples help you understand the structure and content of error messages returned by the API in different situations.
"Please include an attachment or attachments parameter":
This error occurs when you make a request to the API without including any attachment or attachments parameter. It indicates that you need to provide either a single attachment or an array of attachments in your API request for it to be processed successfully.
"One or more attachments could not be downloaded":
This error message indicates that there was an issue with downloading one or more attachments specified in your API request. It suggests that there might be connectivity issues or problems with the specified attachment URLs. You may need to ensure that the attachment URLs are valid and accessible for the Scale API to download and process them.
"One or more attachments could not be downloaded (specific attachment errors)":
This error is similar to the previous one but provides more specific information about the attachments that couldn't be downloaded. It might include additional details such as the URLs or identifiers of the problematic attachments. This information helps you identify and troubleshoot the specific attachments that failed to download.
400 Bad Request
{
"status_code": 400,
"error": "Please include an attachment or attachments parameter."
}
Attachment 403
// 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
}
]
}
Failed Lidar Frame Processing
// 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
}
}
]
}