Skip to content

Latest commit

 

History

History
52 lines (46 loc) · 6.08 KB

File metadata and controls

52 lines (46 loc) · 6.08 KB

Zernio::SendInboxMessageRequest

Properties

Name Type Description Notes
account_id String Social account ID
message String Message text [optional]
attachment_url String URL of the attachment to send (image, video, audio, or file). The URL must be publicly accessible. For binary file uploads, use multipart/form-data instead. On WhatsApp, combining an image, video, or file with `buttons` renders the media as the header of one interactive reply-button message; audio cannot be combined with buttons. [optional]
category String WhatsApp only (Meta Direct Send). Sends this message as a business-initiated UTILITY message without an approved template, for example outside the 24-hour customer service window; Meta matches or auto-creates a template asynchronously. The WhatsApp Business Account must be eligible for Direct Send, otherwise the send fails with an error telling you to use an approved message template instead. Supported only for text messages (link preview ok) and interactive messages (reply buttons, CTA URL buttons, voice-call button, header of text/image/video/document). Cannot be combined with template, attachments, location, or contacts. Utility messages only; marketing content is not allowed under this category. Accepted on the JSON body only, not on multipart requests. [optional]
link_preview Boolean WhatsApp only. Set false to send the message without a link-preview thumbnail for the first URL in the text. Defaults to true, which is how every WhatsApp text has been sent to date. Ignored on other platforms. Accepted on the JSON body only, not on multipart requests. [optional][default to true]
attachment_type String Type of attachment. Defaults to file if not specified. [optional]
attachment_name String WhatsApp only. Display name for a document sent via attachmentUrl with attachmentType: file (e.g. "Report.pdf"). Maps to the recipient's file name; without it WhatsApp derives the name from the URL and shows "Untitled". Ignored for image/video/audio and for binary uploads (which use the uploaded file's name). [optional]
voice_note Boolean WhatsApp only. When `true` on an audio attachment, the message is sent as a voice message (PTT) — the recipient sees the waveform + voice-note UI instead of a basic audio attachment. The audio file MUST be `.ogg` encoded with the OPUS codec (mono) per Meta's voice-message contract; other formats are rejected by WhatsApp. Ignored for non-audio attachments. [optional]
quick_replies Array<SendInboxMessageRequestQuickRepliesInner> Quick reply buttons. Mutually exclusive with buttons. Max 13 items. [optional]
buttons Array<SendInboxMessageRequestButtonsInner> Action buttons. Mutually exclusive with quickReplies. Max 3 items. Instagram / Facebook: also mutually exclusive with `template`. A Meta message carries one body shape, so sending both is a 400 rather than a silent drop of the buttons. WhatsApp: buttons always render as interactive reply buttons. Only `title` and `payload` are used — `type`, `url`, and `phone` are ignored (WhatsApp has no URL/phone button in this field; use the `interactive` field with `type: cta_url` for a link button). `payload` becomes the button reply ID delivered on the `message.received` webhook when the user taps. To send a simple reply-button message, provide `title` + `payload` and set `type: postback`, e.g. `{ &quot;type&quot;: &quot;postback&quot;, &quot;title&quot;: &quot;Yes&quot;, &quot;payload&quot;: &quot;yes&quot; }`. Combine `buttons` with `attachmentUrl` and `attachmentType` `image`, `video`, or `file` to render one WhatsApp message with a media header, body text, and reply buttons. Audio is not a supported interactive header and returns 400 when combined with buttons. [optional]
template SendInboxMessageRequestTemplate [optional]
interactive SendInboxMessageRequestInteractive [optional]
reply_markup SendInboxMessageRequestReplyMarkup [optional]
messaging_type String Facebook messaging type. Required when using messageTag. [optional]
message_tag String Facebook message tag for messaging outside 24h window. Requires messagingType MESSAGE_TAG. Instagram only supports HUMAN_AGENT. [optional]
reply_to String Platform message ID to quote-reply to. For WhatsApp, pass the wamid; for Telegram, the Telegram message ID (both available in message.platformMessageId from webhooks or the list-messages endpoint). On Slack it threads the reply (thread_ts) instead of quoting. Silently ignored on platforms without send-side reply support, including Instagram and Facebook Messenger (Meta's Send API rejects reply_to on Instagram and does not expose it on Messenger). [optional]
location SendInboxMessageRequestLocation [optional]
contacts Array<SendInboxMessageRequestContactsInner> WhatsApp-only. Send one or more contact cards. [optional]

Example

require 'zernio-sdk'

instance = Zernio::SendInboxMessageRequest.new(
  account_id: null,
  message: null,
  attachment_url: null,
  category: null,
  link_preview: null,
  attachment_type: null,
  attachment_name: null,
  voice_note: null,
  quick_replies: null,
  buttons: null,
  template: null,
  interactive: null,
  reply_markup: null,
  messaging_type: null,
  message_tag: null,
  reply_to: null,
  location: null,
  contacts: null
)