R Client for 'whapi.cloud'
Ensure "messages" or "updates" input is always a list of objects
Build Whapi service sections from a tibble (with section column)
Check Whapi.Cloud channel health and status
Clip long text with ellipsis
Coerce and normalize button specs for Whapi interactive messages
Coerce and validate MIXED buttons (url / call / copy) for Whapi
Coerce and validate QUICK REPLY buttons for Whapi
Build common message blocks for Whapi interactive messages
Days between two dates
Extract common fields from Whapi API responses
Flatten Whapi webhook payload into tidy rows for persistence (robust)
Safe date formatting
Get WhatsApp contact profile(s) via Whapi.Cloud
Get a WhatsApp message by ID (Whapi.Cloud)
Log details of a Plumber request object using the cli package
Convert R objects to pretty JSON for logging
Make identifiers unique while preserving order
Mark a WhatsApp message as READ (Whapi.Cloud)
Digit matching helper (with partial threshold)
Normalize WhatsApp contact IDs (phone numbers only)
Keep only digits from a string
Parse the raw body of a Plumber request
Parse a text message into command and arguments (Whapi helper)
Parse Whapi "messages" array into a normalized tibble
Parse Whapi "messages_updates" array (patch events) into a tibble
Perform an HTTP request to Whapi.Cloud
React to a WhatsApp message (Whapi.Cloud)
Redact sensitive values in headers/cookies
Collapse a "changes" vector into a single string
Send a DOCUMENT via Whapi.Cloud (file, url, or base64)
Send an image via Whapi.Cloud (file, url, or base64)
Send a WhatsApp interactive LIST message (Whapi.Cloud)
Send a geographic location via Whapi.Cloud
Send a WhatsApp interactive message mixing URL/CALL/COPY buttons (Whap...
Send a WhatsApp interactive message with QUICK REPLY buttons (Whapi.Cl...
Send a STICKER via Whapi.Cloud (file, url, or base64)
Send a text message via Whapi.Cloud
whapi_slugify strings for safe IDs (e.g., button IDs in Whapi)
Convert text to lowercase ASCII (remove accents)
Safely coerce to numeric
Coerce to POSIXct (UTC) safely
Convert numeric timestamp to POSIXct (UTC)
Convert R objects into pretty JSON (character)
Truncate long strings for logging
Validate list_sections for Whapi LIST interactive messages
Provides an 'R' interface to the 'Whapi' 'API' <https://whapi.cloud>, enabling sending and receiving 'WhatsApp' messages directly from 'R'. Functions include sending text, images, documents, stickers, geographic locations, and interactive messages (buttons and lists). Also includes 'webhook' parsing utilities and channel health checks.
Useful links