Download an attachment of a message
/api/v1/bookings/{booking_id}/messages/{message_id}/attachments/{index}messages.readThe 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)requiredBooking id.
message_idstring (uuid)requiredMessage id.
indexstringrequiredindexof the attachment in the message.
Responses
200The file.
401Error code: unauthorized, connection_revoked.
Error codes
unauthorizedThe 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_revokedThe 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_blockedThe 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_suspendedZenHost suspended your App, or no longer allows it on this account. Stop calling and contact ZenHost.forbidden_permissionYour App was not granted the Permission this endpoint requires.
404Error code: not_found.
Error codes
not_foundThe 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_limitedToo many calls on this App Connection. Wait for the number of seconds inRetry-After.
500Error code: internal_error.
Error codes
internal_errorZenHost failed to answer. Retry later with a back-off.
502Error code: attachment_unavailable.
Error codes
attachment_unavailableThe Sales Channel could not hand over the attachment right now. Retry later with a back-off.