MyNixOS website logo
Description

R Client for 'whapi.cloud'.

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.

whapi whapi website

CRAN_Status_Badge CRAN Downloads License

R wrapper for whapi.cloud — a lightweight WhatsApp API.

Overview

The whapi package provides a tidyverse-friendly interface to the whapi.cloud API, allowing you to send, receive, and manage WhatsApp messages programmatically in R.

Features include:

  • Sending text, image, document, sticker, and location messages;
  • Sending interactive messages (quick replies, mixed actions, lists);
  • Reacting to or marking messages as read;
  • Fetching message details and contact profiles;
  • Checking channel health and status;
  • Helpers for logging and webhook flattening.

All outputs are returned as tibbles for easy integration into tidyverse workflows.

Installation

The package is under development. Install from source:

# install.packages("devtools")
devtools::install_github("StrategicProjects/whapi")

Setup

  1. Get an API token from Whapi.Cloud.
  2. Store it as an environment variable:
Sys.setenv(WHAPI_TOKEN = "your_api_token_here")
  1. Load the package:
library(whapi)

Example Usage

Send a Text Message

whapi_send_text("5581999999999", "Hello from R! ✅")

Send an Image

whapi_send_image("5581999999999", image = "card.png", type = "file", caption = "Card")

Send a Sticker

whapi_send_sticker("5581999999999", sticker = "sticker.webp", type = "file")

Send an Interactive Quick Reply

whapi_send_quick_reply(
  to = "5581999999999",
  body_text = "Do you confirm?",
  buttons = tibble::tribble(~title, "YES", "NO")
)

React to a Message

whapi_react_to_message("PsqXn5SAD5v7HRA-wHqB9tMeGQ", "❤️")

Mark a Message as Read

whapi_mark_message_read("PsqXn5SAD5v7HRA-wHqB9tMeGQ")

Get a Contact Profile

whapi_get_contact_profile("5581999999999")

Check Channel Health

whapi_check_health()

Contributing

If you find any issues or have feature requests, feel free to create an issue or a pull request on GitHub.


License

This package is licensed under the MIT License. See the LICENSE file for more details.

Metadata

Version

0.0.2

License

Unknown

Platforms (76)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-freebsd
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64-windows
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-linux
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows