Unicom360.WhatsApp.SessionMessage (Unicom360 v0.1.0)

Copy Markdown View Source

A WhatsApp session message, built with Unicom360.WhatsApp.Session and sent with Unicom360.WhatsApp.send_session/3.

  • to - the recipient's WhatsApp number.
  • type - "text", "image", "video", "document", "audio", "sticker", "interactive", "location", "contacts" or "reaction".
  • content - the type's own field, in the API's shape (%{"text" => "Hi"}, %{"media" => %{"url" => ...}}, ...).
  • from, reply_to, user_reference_id, callback_url - the common optional fields.

The struct is plain data: change a common field with %{message | user_reference_id: "s-1"}.

Summary

Types

t()

@type t() :: %Unicom360.WhatsApp.SessionMessage{
  callback_url: String.t() | nil,
  content: %{optional(String.t()) => term()},
  from: String.t() | nil,
  reply_to: String.t() | nil,
  to: String.t(),
  type: String.t(),
  user_reference_id: String.t() | nil
}