Menu/bookings/{booking_id}/messages

List the messages of a booking

GET/api/v1/bookings/{booking_id}/messages
Nécessite messages.read

The 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)obligatoire

    Booking id.

Paramètres de requête

  • cursorstring

    next_cursor of the previous page.

  • limitinteger

    Page size.

    min 1 · max 500 · par défaut 100

Réponses

200One page of the messages of the booking.

application/jsonMessageList

  • dataMessage[]obligatoire
    Afficher 10 attributs enfants
    • idstring (uuid)obligatoire
    • directionstringobligatoire

      inbound from the guest, outbound to the guest.

      Parmi : inbound outbound

    • authorMessageAuthorobligatoire

      Who wrote the message. Never carries a guest email or phone, nor the name of the team member.

      Afficher 2 attributs enfants
      • typestringobligatoire

        guest (inbound), host (the host or a team member), zenny (written by Zenny, the ZenHost assistant), automation (a Scheduled Message) or app (an App, see app_name). Version 1 may add values.

        Parmi : guest host zenny automation app

      • app_namestring

        Name of the App that sent the message, when type is app.

    • channelstringobligatoire

      platform is the messaging of the Sales Channel of the booking (Airbnb, Booking.com…). Version 1 may add values.

      Parmi : platform email sms

    • textstringobligatoire
    • subjectstring | nullobligatoire

      Email subject.

    • attachmentsMessageAttachment[]obligatoire
      Afficher 5 attributs enfants
      • indexintegerobligatoire

        Position 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

      • typestringobligatoire

        Only images in version 1; other types may be added.

        Parmi : image

      • file_namestring | nullobligatoire
      • content_typestring | nullobligatoire

        MIME type when known; the download answers with the actual one.

      • urlstring (uri)obligatoire

        Download URL of the file. Call it with the access token of the App Connection, like any other endpoint.

    • delivery_statusstringobligatoire

      received for an inbound message. For an outbound one: pending while it is not confirmed sent (in flight, or its fate is not known yet), sent, or rejected when 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 : received pending sent rejected

    • sent_atstring (date-time)obligatoire
    • created_atstring (date-time)obligatoire

      When ZenHost recorded the message; the list is sorted on it.

  • next_cursorstring | nullobligatoire

    Pass it as cursor to read the next page; null on the last page.

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.
422Error code: validation_failed.

Codes d’erreur

  • validation_failed La requête, les en-têtes ou le corps sont invalides ; details.issues désigne chaque problème (path, message, et maximum quand 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_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