Error codes
Wherever possible, the Cargosnap API tries to use the appropriate HTTP status code to indicate problems or errors when invoking an API resource; the status code and reason message are additionally returned in the status section of the response body as status and reason respectively. Both the HTTP status and the API status should be checked; it is entirely possible to have an HTTP status of 200 returned because the API request was well formed but to have an API error code returned because the request generated an error or contained an invalid parameter. Specifically, attempting to request an invalid file would return an HTTP status of 200 and an API error code of 300.
200 The API resource call was well formed and successfully handled; additional information may also be available in the status section of the response body.
400 An attempt was made to access an SSL-only API endpoint via vanilla HTTP.
400 A required parameter was missing or contained an invalid value.
401 An invalid Cargosnap API token was supplied or the Cargosnap API token was missing.
404 An invalid or unknown API resource was invoked.
405 An invalid HTTP request method was used to access an API resource.
422 A required parameter was missing or contained an invalid value.
500 A problem has occurred with the Cargosnap API.
503 A problem has occurred with the Cargosnap API.
Additional Cargosnap specific error details are also provided in the status section of the response body.