whapi0.0.2 package

R Client for 'whapi.cloud'

whapi_as_array

Ensure "messages" or "updates" input is always a list of objects

whapi_build_servicos_sections

Build Whapi service sections from a tibble (with section column)

whapi_check_health

Check Whapi.Cloud channel health and status

whapi_clip_text

Clip long text with ellipsis

whapi_coerce_buttons_base

Coerce and normalize button specs for Whapi interactive messages

whapi_coerce_buttons_mixed

Coerce and validate MIXED buttons (url / call / copy) for Whapi

whapi_coerce_buttons_quick

Coerce and validate QUICK REPLY buttons for Whapi

whapi_common_blocks

Build common message blocks for Whapi interactive messages

whapi_date_diff_days

Days between two dates

whapi_extract_common_fields

Extract common fields from Whapi API responses

whapi_flatten_webhook

Flatten Whapi webhook payload into tidy rows for persistence (robust)

whapi_fmt_date

Safe date formatting

whapi_get_contact_profile

Get WhatsApp contact profile(s) via Whapi.Cloud

whapi_get_message

Get a WhatsApp message by ID (Whapi.Cloud)

whapi_log_plumber_req

Log details of a Plumber request object using the cli package

whapi_log_pretty_json

Convert R objects to pretty JSON for logging

whapi_make_unique

Make identifiers unique while preserving order

whapi_mark_message_read

Mark a WhatsApp message as READ (Whapi.Cloud)

whapi_match_digits

Digit matching helper (with partial threshold)

whapi_normalize_to

Normalize WhatsApp contact IDs (phone numbers only)

whapi_only_digits

Keep only digits from a string

whapi_parse_body

Parse the raw body of a Plumber request

whapi_parse_command

Parse a text message into command and arguments (Whapi helper)

whapi_parse_messages

Parse Whapi "messages" array into a normalized tibble

whapi_parse_updates

Parse Whapi "messages_updates" array (patch events) into a tibble

whapi_perform_request

Perform an HTTP request to Whapi.Cloud

whapi_react_to_message

React to a WhatsApp message (Whapi.Cloud)

whapi_redact

Redact sensitive values in headers/cookies

whapi_scalarize_change

Collapse a "changes" vector into a single string

whapi_send_document

Send a DOCUMENT via Whapi.Cloud (file, url, or base64)

whapi_send_image

Send an image via Whapi.Cloud (file, url, or base64)

whapi_send_list

Send a WhatsApp interactive LIST message (Whapi.Cloud)

whapi_send_location

Send a geographic location via Whapi.Cloud

whapi_send_mixed_actions

Send a WhatsApp interactive message mixing URL/CALL/COPY buttons (Whap...

whapi_send_quick_reply

Send a WhatsApp interactive message with QUICK REPLY buttons (Whapi.Cl...

whapi_send_sticker

Send a STICKER via Whapi.Cloud (file, url, or base64)

whapi_send_text

Send a text message via Whapi.Cloud

whapi_slugify

whapi_slugify strings for safe IDs (e.g., button IDs in Whapi)

whapi_to_ascii_lower

Convert text to lowercase ASCII (remove accents)

whapi_to_num

Safely coerce to numeric

whapi_to_posix

Coerce to POSIXct (UTC) safely

whapi_to_posixct

Convert numeric timestamp to POSIXct (UTC)

whapi_to_pretty_json

Convert R objects into pretty JSON (character)

whapi_trunc

Truncate long strings for logging

whapi_validate_list_sections

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.

  • Maintainer: Andre Leite
  • License: MIT + file LICENSE
  • Last published: 2025-09-29