Cloud API messaging: text, templates, media, read receipts, reactions.
Every function accepts an explicit Noizu.WhatsApp.Client first or omits it
(a default client is built from the environment). Recipients are normalized
to digits-only E.164; failures return {:error, %Noizu.WhatsApp.Error{}}
with the phone masked.
Graph code 131047 errors carry kind: :window_closed — the 24-hour
customer-service window has lapsed; use send_template/4 (an approved
template) to re-open it.
Summary
Functions
Marks an inbound message as read.
Reacts to an inbound message (:emoji may be an empty string to remove).
Sends media by link or by media id (as uploaded via Media.upload/2).
Sends an approved template — the only way to start a conversation outside
the 24h window. lang is a template language code (e.g. "en_US");
components is the Cloud API components list (header/body/button params).
Sends a free-form text message.
Functions
@spec mark_read(String.t()) :: Noizu.WhatsApp.Request.result()
Marks an inbound message as read.
@spec react(term(), String.t(), String.t()) :: Noizu.WhatsApp.Request.result()
Reacts to an inbound message (:emoji may be an empty string to remove).
@spec send_media( Noizu.WhatsApp.Client.t() | term(), term(), :image | :document | :audio | :video | :sticker, term(), keyword() ) :: Noizu.WhatsApp.Request.result()
Sends media by link or by media id (as uploaded via Media.upload/2).
type is :image | :document | :audio | :video | :sticker; link_or_id is
a URL (link: true implied) or an uploaded media id (binary/string id used
as id:). Options: :caption (image/document/video), :filename
(document).
@spec send_template( Noizu.WhatsApp.Client.t() | term(), term(), String.t(), String.t(), list() ) :: Noizu.WhatsApp.Request.result()
Sends an approved template — the only way to start a conversation outside
the 24h window. lang is a template language code (e.g. "en_US");
components is the Cloud API components list (header/body/button params).
@spec send_text(Noizu.WhatsApp.Client.t() | term(), term(), String.t(), keyword()) :: Noizu.WhatsApp.Request.result()
Sends a free-form text message.
Options: :preview_url (true renders a link preview), :reply_to
(message id threaded under context).