Response Format
All responses from the CAPTUR3D API are JSON-encoded and follow a consistent structure to ensure easy parsing and error handling.
Successful Responses
Requests that succeed will return a 2xx HTTP status code, along with a data object containing relevant information.
e.g.
HTTP status: 200
{
"data": {
"foo": "bar",
"moo": "cow",
"animals": ["cat", "dog", "hawk"]
}
}
Common Success Status Codes
|
Status Code |
Meaning |
|---|---|
|
200 OK |
Request was successful, and the response contains data. |
|
201 Created |
The resource was successfully created. |
|
204 No Content |
The request was successful, but there is no response body (e.g., after a DELETE request). |
Error Responses
If a request fails, the API will return a 4xx or 5xx HTTP status code, along with an errors array that provides details about what went wrong.
e.g.
HTTP status: 401
{
"errors": [
{
"status": "401",
"title": "Authorization Missing",
"detail": "You must provide an API key as a bearer token in the 'Authorization' header. e.g 'Bearer <my-api-key>'"
}
]
}
Common Error Status Codes
|
Status Code |
Meaning |
|---|---|
|
401 Unauthorized |
Authentication failed or API key is missing. |
|
403 Forbidden |
The API key does not have permission for this action. |
|
404 Not Found |
The requested resource does not exist (or you do not have access to it). |
|
422 Unprocessable Entity |
The request was missing required parameters or invalid in some other way |
|
429 Too Many Requests |
The request was rejected due to rate limiting. |
|
500 Internal Server Error |
An error occurred on our side. We will be notified and will investigate. |
Handling Errors
To properly handle errors in your application:
-
Check the HTTP status code to determine the type of error.
-
Read the
errorsarray for specific details on what went wrong. -
Implement retries (if applicable) for transient errors like
429 Too Many Requestsor500 Internal Server Error.