Errors

All of our APIs use standard HTTP status codes to indicate success or failure. The following table shows the typical error ranges, and what they mean:

Status
Description

200-299

Statuses in the 2xx range indicate success. Requests will typically return a 200 OK status, but some requests may return a 204 No Content if there is no response to return.

400-499

Statuses in the 4xx range indicate that the request has failed because of some kind of client error. Typically this will either be a 400 Bad Request if you send a request that fails validation, a 401 Unauthorized if you send a request without your authorization token, or a 404 Not Found if you request an item that doesn't exist.

500

A 500 Internal Server Error will be returned if an unexpected problem occurs within the API that is not a problem with the request that was made. If you get a 500 returned, you should contact ResDiary support so that we can investigate what went wrong.

Validation errors

If your request fails validation for some reason, the server will respond with a 400 Bad Request. The response body will contain more information about why the request has failed validation. The format of the response body is shown in the following table:

Message

string A description of the validation error.

ValidationErrors

Array of validation error objects Contains the validation errors.

{
    "Message": "Parameter 'searchParameters' has failed validation.",
    "ValidationErrors": [{
        "PropertyName": "VisitDate",
        "ErrorMessage": "'Visit Date' must not be empty."
    }, {
        "PropertyName": "PartySize",
        "ErrorMessage": "'Party Size' must not be empty."
    }]
}

Unexpected errors

If an unexpected error occurs with your request, the server will respond with a 500 status code, and a standard error object in the response. The object has the following format.

Message

string A description of the error. For unexpected errors, this will just tell you to contact support.

ValidationErrors

Array of validation error objects Always null for unexpected errors.

ApiRequestId

string A unique id for the web request.

ApiRequestUrl

string The URL to the request viewer page, where detailed information about the error can be viewed.

IMPORTANT NOTE:

You can see all the error logs generated by your account, complete with the request body, response body and any validation errors by checking the Request Logs page.

Last updated

Was this helpful?