Error responses
The Hotspot API produces two kinds of result: an authentication failure (HTTP 401) and a successful response (HTTP 200). An empty guest list is not an error. Below are the situations you may run into and what to do in each.
HTTP status codes#
| Code | Body | Meaning and what to do |
|---|---|---|
200 | {"success": 1, "otelde": [...]} | Success. Process the list. |
200 | {"success": 1, "otelde": []} | Success; nobody is in house. See the note on empty lists below. |
401 | {"success": 0} | ApiKey header missing or key not recognised. Do not retry; check the key and alert the administrator. |
404 | Error page | Wrong path. Verify the path is exactly /public/json/customer/inhotel. |
405 | Error page | A method other than POST was used (e.g. GET from a browser). |
5xx / timeout | — | Temporary server or network error. Retry with increasing delays (30 s, 1 min, 5 min) and keep using the last successful list meanwhile. |
Empty list#
otelde: [] means no checked-in guests are in house, which is normal for small hotels out of season. However, a list that was full on the previous query and is suddenly empty usually points to an operational mistake on the hotel side (a wrong bulk check-out, a reservation status change). Before closing every Wi-Fi account, confirm the list came back empty on two consecutive queries.
Retries and timeouts#
- Use a 10-second request timeout; even for large hotels the list returns within that.
- Retry on
5xxand network errors; do not retry401,404or405, which are configuration errors. - Keep the last successful list while a query fails. Close accounts only for guests who dropped off the list in a successful response.
- Count consecutive failures and notify the administrator past a threshold (e.g. 15 minutes).
Common situations#
| Situation | Likely cause | What to do |
|---|---|---|
| Guest not in the list | Reception has not checked the guest in, the reservation was cancelled, the guest is not flagged “in house”, or has checked out. | Show “room number and surname did not match” on the portal and refer the guest to reception. No need to refetch; the guest appears on the next sync. |
| Several records for the same room | More than one guest is staying in the room; each is a separate record. | Normal. Open accounts per guest (unique). |
identityNumber empty | The guest was registered without ID details. | Fall back to surname + date of birth for matching; leave the field empty in the Law 5651 record and tie it to unique. |
roomName does not match | The guest typed “0104” or “Room 104” instead of “104”; the value is a string. | Normalise both sides before comparing; do not convert to a number. |
checkout in the past but guest still listed | The guest extended the stay or is checking out late and reception has not processed it yet. | Keep access open while the guest is in the list; update the session end when checkout changes. |