Menu/bookings/{booking_id}/messages/{message_id}/attachments/{index}

Download an attachment of a message

GET/api/v1/bookings/{booking_id}/messages/{message_id}/attachments/{index}
Requires messages.read

The file itself, with its Content-Type. Use the url given in attachments by GET /bookings/{booking_id}/messages. Downloads count against the read rate limit.

A booking outside the Connection Scope, a message of another booking, an unknown index, a file the Sales Channel no longer holds or a file that cannot be served as a photo answer not_found. attachment_unavailable means the Sales Channel could not hand over the file right now: try again later.

The file is streamed as it arrives, without Content-Length. A file that turns out larger than 10 MB on the way, or a Sales Channel transfer that breaks off, ends the connection before the body is complete: treat a download that does not end normally as failed and retry later.

Parameters

Path parameters

  • booking_idstring (uuid)required

    Booking id.

  • message_idstring (uuid)required

    Message id.

  • indexstringrequired

    index of the attachment in the message.

Responses

200The file.
401Error code: unauthorized, connection_revoked.

Error codes

  • unauthorized The access token is missing, unknown, expired or revoked, or was issued before the account connected the App again. Refresh it; if refreshing fails, ask the owner to connect again.
  • connection_revoked The owner revoked the App Connection (or your App revoked its own refresh token). Stop calling for this account and drop its tokens.
402Error code: subscription_blocked.

Error codes

  • subscription_blocked The ZenHost subscription of the account is blocked (unpaid, cancelled…). The connection is kept: tell your customer, calls work again once the subscription is restored.
403Error code: app_suspended, forbidden_permission.

Error codes

  • app_suspended ZenHost suspended your App, or no longer allows it on this account. Stop calling and contact ZenHost.
  • forbidden_permission Your App was not granted the Permission this endpoint requires.
404Error code: not_found.

Error codes

  • not_found The resource does not exist or is outside the Connection Scope (both look the same), or the path is not an endpoint of /api/v1.
429Error code: rate_limited.

Header 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.

Error codes

  • rate_limited Too many calls on this App Connection. Wait for the number of seconds in Retry-After.
500Error code: internal_error.

Error codes

  • internal_error ZenHost failed to answer. Retry later with a back-off.
502Error code: attachment_unavailable.

Error codes

  • attachment_unavailable The Sales Channel could not hand over the attachment right now. Retry later with a back-off.

Every error code and what to do