Error messages

Structure

When an API endpoint returns an error it always contain a descriptive message about the error. It may also contain a code and a subcode to be able to assist the application to show a more user friendly response.

Code

The error code is an integer and classifies the error into one of these categories:

Not found 1
Access denied 2
Offline 3
Invalid argument 4
Length 5
Out of range 6
Unsupported 7

Subcode

The subcode is a detailed id defining what kind of resource or argument failed. This can be used to make the error message more unique to the user.

Example responses

JSON:
{
    
"error""Client \"123\" was not found!",
    
"code"1,
    
"subcode""79d23c61-951b-4c25-ba77-3e189550499d"
}
        

XML:
<room>
    <
error>Client "123" was not found!</error>
    <
code>1</code>
    <
subcode>79d23c61-951b-4c25-ba77-3e189550499d</subcode>
</
room>