List the messages of a booking
/api/v1/bookings/{booking_id}/messagesmessages.readThe conversation of a booking with its guest, oldest message first and paged with next_cursor. Each message gives its direction, its author (the guest, the host or a team member, Zenny, an automation or an App, named), its channel, its text, its attachments and its delivery status.
A booking without any message answers an empty list. Scheduled Messages not sent yet are not listed. The author never carries the guest email or phone, nor the name of the team member: those stay out of reach, and the guest contact details stay under guests.read on GET /bookings. The text is the message as written, so it holds whatever the guest or the host typed.
Download an attachment from its url, with the access token of the App Connection. 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.
Paramètres de requête
cursorstringnext_cursorof the previous page.limitintegerPage size.
min 1 · max 500 · par défaut 100
Réponses
200One page of the messages of the booking.
application/jsonMessageList
dataMessage[]obligatoireAfficher 10 attributs enfantsMasquer les attributs enfants
idstring (uuid)obligatoiredirectionstringobligatoireinboundfrom the guest,outboundto the guest.Parmi :
inboundoutboundauthorMessageAuthorobligatoireWho wrote the message. Never carries a guest email or phone, nor the name of the team member.
Afficher 2 attributs enfantsMasquer les attributs enfants
typestringobligatoireguest(inbound),host(the host or a team member),zenny(written by Zenny, the ZenHost assistant),automation(a Scheduled Message) orapp(an App, seeapp_name). Version 1 may add values.Parmi :
guesthostzennyautomationappapp_namestringName of the App that sent the message, when
typeisapp.
channelstringobligatoireplatformis the messaging of the Sales Channel of the booking (Airbnb, Booking.com…). Version 1 may add values.Parmi :
platformemailsmstextstringobligatoiresubjectstring | nullobligatoireEmail subject.
attachmentsMessageAttachment[]obligatoireAfficher 5 attributs enfantsMasquer les attributs enfants
indexintegerobligatoirePosition of the file in the message, as in the download URL. Files that cannot be downloaded are left out, so indexes may skip.
min 0
typestringobligatoireOnly images in version 1; other types may be added.
Parmi :
imagefile_namestring | nullobligatoirecontent_typestring | nullobligatoireMIME type when known; the download answers with the actual one.
urlstring (uri)obligatoireDownload URL of the file. Call it with the access token of the App Connection, like any other endpoint.
delivery_statusstringobligatoirereceivedfor an inbound message. For an outbound one:pendingwhile it is not confirmed sent (in flight, or its fate is not known yet),sent, orrejectedwhen it did not reach the guest: the Sales Channel refused it, or its send failed or stayed unconfirmed for a minute, as the ZenHost inbox shows it. Version 1 may add values.Parmi :
receivedpendingsentrejectedsent_atstring (date-time)obligatoirecreated_atstring (date-time)obligatoireWhen ZenHost recorded the message; the list is sorted on it.
next_cursorstring | nullobligatoirePass it as
cursorto read the next page;nullon the last page.
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.
422Error code: validation_failed.
Codes d’erreur
validation_failedLa requête, les en-têtes ou le corps sont invalides ;details.issuesdésigne chaque problème (path,message, etmaximumquand une valeur ou une liste est trop grande).
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.