Menu/bookings/{booking_id}/lock-codes

Get the access codes of a booking

GET/api/v1/bookings/{booking_id}/lock-codes
Nécessite lock_codes.read

One entry per Lock of the booking's Property, by Lock Scope (unit, building, parking…), with its Access Window and its state. A key box gives its static_code, which does not change from one stay to the next. A smart lock gives the newest lock_code issued for this booking that is not revoked, pending included: the code is valid, the lock has not confirmed it yet. A Lock without a code for this booking is left out. A cancelled booking returns an empty list, and a revoked code is never returned.

ZenHost does not restrict when you read a code. Hand it to the guest only from the arrival day to the departure day, as Zenny does. A booking outside the Connection Scope answers not_found, exactly like a missing one.

Paramètres

Paramètres de chemin

  • booking_idstring (uuid)obligatoire

    Booking id.

Réponses

200The access codes of the booking.

application/jsonLockCodeList

  • dataLockCode[]obligatoire

    One entry per Lock of the Property that has a code for this booking, the unit first. Empty for a cancelled booking.

    Afficher 6 attributs enfants
    • lock_scopestringobligatoire

      The area the Lock opens: one of unit, building, parking, mailbox, garage, storage, common_area, pool, garden, other. A Property has at most one Lock per scope.

    • kindstringobligatoire

      lock_code: a code issued for this booking only. static_code: the fixed code of a key box, the same from one stay to the next.

      Parmi : lock_code static_code

    • codestringobligatoire
    • valid_fromstring (date-time) | nullobligatoire

      Start of the Access Window (operational check-in time); null for a static_code.

    • valid_untilstring (date-time) | nullobligatoire

      End of the Access Window: the operational check-out time plus the Property's check-out grace, if any; null for a static_code.

    • statusstringobligatoire

      pending: the code is issued but the lock has not confirmed it yet. active: confirmed. A static_code is always active.

      Parmi : pending active

401Error code: unauthorized, connection_revoked.

Codes d’erreur

  • unauthorized Le jeton d’accès est absent, inconnu, expiré ou révoqué, ou a été émis avant que le compte ne reconnecte l’App. Rafraîchissez-le ; si le rafraîchissement échoue, demandez au propriétaire de reconnecter l’App.
  • connection_revoked Le propriétaire a révoqué la connexion d’App (ou votre App a révoqué son propre jeton de rafraîchissement). Cessez les appels pour ce compte et supprimez ses jetons.
402Error code: subscription_blocked.

Codes d’erreur

  • subscription_blocked L’abonnement ZenHost du compte est bloqué (impayé, résilié…). La connexion est conservée : prévenez votre client, les appels refonctionnent dès que l’abonnement est rétabli.
403Error code: app_suspended, forbidden_permission.

Codes d’erreur

  • app_suspended ZenHost a suspendu votre App, ou ne l’autorise plus sur ce compte. Cessez les appels et contactez ZenHost.
  • forbidden_permission Votre App n’a pas reçu la permission que cet endpoint exige.
404Error code: not_found.

Codes d’erreur

  • not_found La ressource n’existe pas ou est hors du périmètre de connexion (les deux cas sont indiscernables), ou le chemin n’est pas un endpoint de /api/v1.
429Error code: rate_limited.

En-tête Retry-After — Seconds to wait before the next call is allowed. Limits per App Connection: 60 reads (GET), 10 writes (other POST) and 30 messages sent to guests per minute.

Codes d’erreur

  • rate_limited Trop d’appels sur cette connexion d’App. Attendez le nombre de secondes indiqué dans Retry-After.
500Error code: internal_error.

Codes d’erreur

  • internal_error ZenHost n’a pas pu répondre. Réessayez plus tard avec un délai croissant.

Tous les codes d’erreur et la conduite à tenir