Error handling

We provide name based errors

ForHotel uses conventional HTTP response codes to indicate the success or failure of an API request. In general: Codes in the 2xx range indicates success. Codes in the 4xx range indicate an error that failed given the information provided (e.g., a required parameter was omitted, validation errors, etc.). Codes in the 5xx range indicates an error with the ForHotel servers and you should retry.

Each error response MUST include error Object with error details.

{
     "error_code": "VALIDATION_ERROR",
     "error_reason": "Fild size `name` greater than 255 characters",
}

Errors Object MUST include error_code field and other fields is optional.

Error dictionary

Base Errors

Code
Description

Something went wrong on the server

General error

Invalid provided argument

Illegal provided argument

Requested or provided entity not found

Provided argument is not valid

Security Errors

Code
Description

General security error

Unauthorized access

Missing token

Corrupted token

Token has expired

Invalid login credentials

Permission error

Access is denied

Last updated