Errors

As with any system, while interacting with the Housemates API, there may be instances when things don't go quite as planned. Missteps can occur, but don't worry, most of the time they are easily rectifiable and often arise from minor oversights in the request.

To determine whether your API request was successful, you can check the status code in the API response. If the request is unsuccessful, the 'error type' and 'error message' provide valuable context about the issue, facilitating basic debugging on your part.


Status codes

Here is a list of the different categories of status codes returned by the Housemates Connect API. Use these to understand if a request was successful.

  • Name
    2xx
    Type
    Description

    A 2xx status code indicates a successful response.

  • Name
    4xx
    Type
    Description

    A 4xx status code denotes a client-side error. This suggests that the issue originated from the request sent, indicating a correction is needed on your end.

  • Name
    5xx
    Type
    Description

    A 5xx status code signifies a server-side error. They denote issues on our end. If you see this error, please reach out to us at support team.


Error Response

In the event of an unsuccessful request, the Housemates API will provide an error response, which includes an error type and message. These details serve as a guide to pinpoint the issue and formulate a solution. The error messages are designed to be informative and most of the time, they are self-explanatory.

Attributes

  • Name
    success
    Type
    boolean
    Description

    This property denotes if the request was successful or not.

  • Name
    code
    Type
    integer
    Description

    This is the Housemates' internal error code. It is used to identify the error.

  • Name
    locale
    Type
    string
    Description

    This is the locale of the error message.

  • Name
    message
    Type
    string
    Description

    This is the error message. It is designed to be informative and most of the time, it is self-explanatory.

  • Name
    data
    Type
    null
    Description

    This is the data associated with the error. It is usually null.

Error response example

{
  "success":false,
  "code": 1003,
  "locale":"en",
  "message":"api.no_properties_found",
  "data":null
}

Http status codes summary

Housemates Connect API will return the following HTTP status codes in response to requests:

Status codeDescription
200 - OKEvery thing worked as expected
201 - CreatedSuccessfuly created the resource
400 - Bad RequestThe request was unacceptable, often due to missing a required parameter
401 - UnauthorizedNo valid API key provided
403 - ForbiddenThe API key doesn't have permissions to perform the request
404 - Not FoundThe requested resource doesn't exist
405 - Method Not AllowedThe HTTP method used is not allowed
422 - Unprocessable ContentUsually returned when the validation fails
429 - Too Many RequestsToo many requests hit the API too quickly
500, 502, 503, 504 - Server ErrorsSomething went wrong on Housemates' end