Unicom360.Webhook.InboundMessage (Unicom360 v0.1.0)

Copy Markdown View Source

The data of a message.received event.

  • message_id - Meta's wamid. id; pass it as :reply_to or to a reaction.
  • channel, from (the customer), to (your number).
  • type - "text", "image", "interactive", ... (open).
  • text - the text, a media caption, or the chosen title of an interactive or button reply.
  • media - a Unicom360.Webhook.InboundMedia or nil.
  • payload - Meta's object, set only for location, contacts (%{"contacts" => [...]}), reaction, sticker and unsupported messages; otherwise nil.
  • reply_to - the wamid. of the message replied to, or nil. An interactive reply's button or row id is not passed on.
  • timestamp, window_expires_at - ISO 8601 strings, as received.
  • raw, extra - the JSON object, and the members this version does not model.

Summary

Types

t()

@type t() :: %Unicom360.Webhook.InboundMessage{
  channel: String.t() | nil,
  extra: map(),
  from: String.t() | nil,
  media: Unicom360.Webhook.InboundMedia.t() | nil,
  message_id: String.t() | nil,
  payload: map() | nil,
  raw: map(),
  reply_to: String.t() | nil,
  text: String.t() | nil,
  timestamp: String.t() | nil,
  to: String.t() | nil,
  type: String.t() | nil,
  window_expires_at: String.t() | nil
}