Errors
An error shows first in its HTTP status: 400 for an incomplete request, 401 for a refused key or token, 404 when something isn't found, 500 when something broke on our side. The body takes one of these two forms.
Refused key or token
When the key, the login or the token is refused, the request stops before the endpoint. The message starts with the error code:
HTTP/1.1 401 Unauthorized
{"error": "102 - Invalid API key."}Endpoint errors
Other errors use the usual response shape: the message is in data, without its code. Rely on the HTTP status, and show the message as is if needed.
HTTP/1.1 404 Not Found
{"data": ["Article not found."], "meta": {}}Codes and messages
| Code | Message |
|---|---|
1 | No article provided. |
2 | Article not found. |
3 | No article content provided. |
4 | Article content must be between 20 and 300 characters long. |
5 | No comment content provided. |
6 | Comment not found. |
7 | No comment content provided. |
8 | Comment content must be between 20 and 300 characters long. |
9 | Missing parameter |
10 | This user not found. |
11 | This username is already associated with an account. |
12 | This email is already associated with an account. |
13 | This email is not valid. |
14 | About me content can not exceed more 300 characters long. |
15 | The file is too large. Allowed maximum size is 1 MB. |
16 | Field confirm_password is missing. |
17 | The password fields must match. |
18 | You have already liked this user. |
21 | You need to provide an email address |
23 | Article already voted |
25 | Invalid subject provided |
26 | Invalid message provided |
27 | Image not found. |
28 | Badge not found. |
29 | Provided vote type is invalid |
30 | Missing datas for twitter connect |
31 | User already liked this post |
32 | User account is banned |
33 | User does not own comment |
34 | You need to validate your account, check your emails. |
35 | Missing datas for facebook connect |
99 | Unknown error |
100 | You must be authenticated in order to access this function. |
102 | Invalid API key. |
103 | Invalid login credentials. |
104 | Invalid or expired API token. |
