Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Sending invalid parameters will result in 400 Bad Request response

    No Format
    HTTP/1.1 400 Bad Request
    Content-Length: 218161
    
    {
     "model":
     {
      "message":"The request cannot be fulfilled due to bad syntax.",
      "errors":
      {
       "field":
       {
        "code":"Error message."
       }
      }
     }
    }
  2. Providing invalid credentials will result in a 401 Unauthorized response

    No Format
    HTTP/1.1 401 Unauthorized
    Content-Length: 67
    
    {"message":"The authorization details given appear to be invalid."}
  3. Attempting to access a resource that is not callable will result in a 403 Forbidden response

    No Format
    HTTP/1.1 403 Forbidden
    Content-Length: 55
    
    {"message":"The requested resource is not accessible."}
  4. Attempting to access a resource that does not exist will result in a 404 Not Found response

    No Format
    HTTP/1.1 404 Not Found
    Content-Length: 52
    
    {"message":"The requested resource does not exist."}
  5. Requesting a format that is not support will result in a 415 Unsupported Media Type response

    No Format
    HTTP/1.1 415 Unsupported Media Type
    Content-Length: 66
    
    {"message":"The format requested is not supported by the server."}
  6. If an unexpected error occurs a 500 Internal Server Error will result

    No Format
    HTTP/1.1 500 Internal Server Error
    Content-Length: 42
    
    {"message":"An unexpected error occured."}
  7. When Blesta is under maintenance mode, the API will return a 503 Service Unavailable response

    No Format
    HTTP/1.1 503 Service Unavailable 
    Content-Length: 81 
    
    {"message":"The requested resource is currently unavailable due to maintenance."}

All error response objects contain an array of input parameters that produced errors. From the example above "field" is the parameter name. Each field may contain one or more error codes along with a related message. Common codes are empty, exists, format, length, and valid, but many more are available. The error code is always the index of the error message, and is used primarily as identifying the type of error encountered.

Timestamps

The API returns all timestamps in UTC time using the following ISO 8601 format:

...