# Errors

All successful requests return http response code 200. All failed requests are returned with a non 20x code response.

The error response is a JSON document with an error description message that is displayed to the user. It can also contain additional fields to describe the details of an occurred error.

{
  "message": "Some error message."
}

Below are the error response codes descriptions

# HTTP 400 Bad Request

The request was not properly built

# HTTP 401 Unauthorized

Authorisation is required

May happen when expired or invalid token was sent, or it was sent in a wrong way. (refer to Authorization)

# HTTP 403 Forbidden

Acces denied

# HTTP 404 Not Found

Data or page are not found

# HTTP 405 Method Not Allowed

Current URL does not support requested mothod

# HTTP 422 Unprocessable Entity

Validation error (wrong data input)

The response also contain information about what field/data caused the validation failure

{
  "message": "Invalid Data",
  "errors": {
    "name": ["Name field is mandatory."],
    "login": ["Login must be at least 6 characters."],
    "email": ["Email must be a valid email address."],
    "password": ["Password field is mandatory."],
    "avatar": ["User Picture is mandatory.", "User Picture must be a file.", "User Picture must be an image."]
  }
}

# HTTP 429 Too Many Requests

Too many requests

# HTTP 500 Internal Server Error

Internal Server Error

# HTTP 503 Service Unavailable

The service is under maintenance or overloaded

Last Updated: 10/19/2020, 2:31:17 PM