REST API error codes

The status of the processing result for the request is send to the client as the http response status, using the standard codes defined in the http protocol. A valid request will return the 200 (OK) status. An invalid request will return one of the codes listed below.

When an error occurs, Accolades will append a description of the error to the account log, available inside the account info page, the Log tab.

Status: 400 (Bad request)

The parameters send with the request are not valid, for the request type. The error is recorded to the account log page.

The response is sent as a JSON object with the following content:

{
"type" : "Error",
"message" : "Bad request",
"code" : "400"
}

Status: 401 (Unauthorized)

The credentials provided for authentication are invalid. There are 3 cases when this error occurs:

The response is sent as a JSON object with the following content:

{
"type" : "Error",
"message" : "Unauthorized",
"code" : "401"
}

Status: 403 (Forbidden)

The server is not processing requests from the source IP, as too many invalid requests have been made, in a defined interval. The IP is temporary blacklisted. The error is not logged to the account (as the server just checks the IP and drops the request, with no further actions).

The response is sent as a JSON object with the following content:

{
"type" : "Error",
"message" : "IP address rejected",
"code" : "403.6"
}

Status: 404 (Not found)

The request is made for a resource that does not exists. The error is not logged to the account, as the server does not process invalid resources.

The response is sent as a JSON object with the following content:

{
"type" : "Error",
"message" : "Not found",
"code" : "404"
}

Status: 413 (Payload Too Large)

The request size is larger than the maximum allowed size.

The response is sent as a JSON object with the following content:

{
"type" : "Error",
"message" : "Payload Too Large",
"code" : "413"
}

Status: 500 (Internal server error)

The server tried to process a request but failed for an unknown reason. You should contact VoIPIT, for a detailed error check. The error will PROBABLY be added to the account log.

If an answer is sent back as a JSON object, then it will have the following content:

{
"type" : "Error",
"message" : "Internal server error",
"code" : "500"
}