All request-based errors to the Kragle api will generate an HTTP 500 (Internal Server Error) with a JSON body describing the error.
The error JSON bodies will have the following format:
{
"code": <numeric error code > 0>,
"msg": <human-readable error message>
}
The following list outlines each possible error code and associated message, and provides a short description/explanation for cases where the error message itself is not self-explanatory.
This error is generally returned if you make a request with invalid parameters. An example would be passing a value for the page
parameter of a paged-results request, which is not an integer.
Your request body contained invalid or inappropriate JSON - please check your request and try again.
This will be returned if the provided request JSON is not valid JSON/cannot be parsed for some reason.
Returned as a result of failed login attempts via the api.
This is a common error which will be returned if the JSON payload of your request contains invalid keys for the operation in question, is missing required parameters, has parameters with invalid values, etc.
Common error returned when an API request for a specific object (ie: via id or name) fails because an object with the specified id (name, etc) does not exist.
Returned when a definition (url) for an is_remote object (Block, Type) does not exist at the given url or the url did not return valid JSON.
The 'definition' provided (either via remote url or directly) for a new/updated Type is invalid.
The 'definition' provided (either via remote url or directly) for a new/updated Block is invalid.
The array representing the Blocks for a new or updated Stack contained an entry with invalid "extra" parameters for the block (ie: in position 2 (3rd element) of one of the Block arrays in the 'blocks' element of the request JSON).
You are missing either the 'schema' or 'data' elements of the JSON payload for a validation request.
You are missing either the 'conversion' or 'data' elements of the JSON payload for a conversion request.
The attempted conversion resulted in an internal error - check your data and/or conversion specifier.
The provided data resulted in an internal error while attempting to validate against the provided schema - check your data and/or schema.