Get the access codes of a booking
/api/v1/bookings/{booking_id}/lock-codeslock_codes.readOne 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)obligatoireBooking id.
Réponses
200The access codes of the booking.
application/jsonLockCodeList
dataLockCode[]obligatoireOne entry per Lock of the Property that has a code for this booking, the unit first. Empty for a cancelled booking.
Afficher 6 attributs enfantsMasquer les attributs enfants
lock_scopestringobligatoireThe 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.kindstringobligatoirelock_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_codestatic_codecodestringobligatoirevalid_fromstring (date-time) | nullobligatoireStart of the Access Window (operational check-in time);
nullfor astatic_code.valid_untilstring (date-time) | nullobligatoireEnd of the Access Window: the operational check-out time plus the Property's check-out grace, if any;
nullfor astatic_code.statusstringobligatoirepending: the code is issued but the lock has not confirmed it yet.active: confirmed. Astatic_codeis alwaysactive.Parmi :
pendingactive
401Error code: unauthorized, connection_revoked.
Codes d’erreur
unauthorizedLe 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_revokedLe 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_blockedL’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_suspendedZenHost a suspendu votre App, ou ne l’autorise plus sur ce compte. Cessez les appels et contactez ZenHost.forbidden_permissionVotre App n’a pas reçu la permission que cet endpoint exige.
404Error code: not_found.
Codes d’erreur
not_foundLa 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_limitedTrop d’appels sur cette connexion d’App. Attendez le nombre de secondes indiqué dansRetry-After.
500Error code: internal_error.
Codes d’erreur
internal_errorZenHost n’a pas pu répondre. Réessayez plus tard avec un délai croissant.