Skip to main content

Errors and limits

Every error has the same shape:

{"error": {"code": "rejected", "message": "Pick one of the offered durations."}}

Use code in your code, and show message to the player: it is written for them and translated into the venue's language.

HTTPcodeWhenWhat the app does
400invalid_jsonThe body is not a JSON objectFix the request
400invalid_parameterA number or date is badly formatted (facility_type_id must be a number.)Fix the request
401unauthorizedNo token, or the token expired, was signed out or revokedDelete the token, show sign-in
401invalid_loginWrong email or passwordShow the message
403method_disabledThe venue turned this sign-in method offRead /config again
403staff_accountA staff login tried the player appShow the message
403forbiddenNot allowedShow the message
404not_foundUnknown booking, or a booking of another playerGo back to the list
422invalid_codeWrong, blocked or expired code on /auth/verify or /auth/signupShow the message, offer a new code
422name_requiredNew player, name missing on /auth/verifyAsk for the name, send again
422out_of_windowDay outside the booking windowLimit the date picker to today..last_date
422nothing_duePayment link asked when nothing is due onlineRefresh the booking
422rejectedA booking rule refused the request: court just taken, too many upcoming bookings, too late to cancel, code asked too often, email already usedShow the message
500server_errorUnexpected error on the server (logged in Odoo)Show the message, let the player try again

A refused request changes nothing in Odoo: nothing is half-booked.

Retrying​

  • Network error or timeout on POST /bookings: retry with the same client_uuid. You get the booking that was made, or a new one if the first request never arrived.
  • 500: retry once after a few seconds; then show the message.
  • 4xx: do not retry the same request; the answer will not change.

Limits​

WhatLimit
Sign-in code6 digits, valid 10 minutes, 5 wrong tries
New code for the same number or emailafter 60 seconds, at most 5 per hour
Codes from one network address20 per hour
Token90 days from its last use
Upcoming bookings per playerset by the venue per facility type (3 by default)
GET /bookings50 bookings per scope
Booking note500 characters

There is no other request limit in the app. If the venue's Odoo is behind a proxy, the limit per network address applies to the address Odoo sees (Odoo.sh passes on the player's real address).

Browsers and CORS​

Native Android and iPhone apps do not need anything. A web or desktop app that calls the API from a browser needs its origin allowed by the venue in Settings > Court Booking > Player apps (API), for example https://play.example.com (several separated by commas). Allowed origins get Access-Control-Allow-Origin, and OPTIONS preflight requests answer 204. The allowed request headers are Authorization, Content-Type and Accept-Language.

Was this page helpful?