| Type: | Package |
| Title: | Client for the 'WAservix' 'WhatsApp' API Gateway |
| Version: | 1.0.1 |
| Description: | Client for the 'WAservix' 'WhatsApp' API Gateway https://tekservix.com/waservix/, which sends 'WhatsApp' messages from your own number connected by QR code. Send texts, images, documents and locations to numbers and groups, check message status, edit, delete and resend messages, check whether a number uses 'WhatsApp', list contacts and groups, and verify incoming event notifications. A 'Tekservix' account with 'WAservix' and a device API key are required. |
| License: | MIT + file LICENSE |
| URL: | https://tekservix.com/waservix/docs/, https://github.com/TekservixHQ/waservix-r |
| BugReports: | https://github.com/TekservixHQ/waservix-r/issues |
| Depends: | R (≥ 4.1.0) |
| Imports: | httr2 (≥ 1.0.0), jsonlite, utils |
| Suggests: | testthat (≥ 3.0.0) |
| Config/testthat/edition: | 3 |
| Encoding: | UTF-8 |
| Language: | en-US |
| Config/roxygen2/version: | 8.1.1 |
| NeedsCompilation: | no |
| Packaged: | 2026-11-12 09:27:31 UTC; runner |
| Author: | Joseph Niyogushimwa [aut, cre], Tekservix [cph, fnd] |
| Maintainer: | Joseph Niyogushimwa <niyogushimwaj967@gmail.com> |
| Repository: | CRAN |
| Date/Publication: | 2026-12-04 16:20:02 UTC |
waservix: Client for the 'WAservix' 'WhatsApp' API Gateway
Description
WAservix WhatsApp API Gateway by Tekservix: send WhatsApp texts, images,
documents and locations from your own number, connected by QR code. You need
a Tekservix account with WAservix and a connected number. Each number has
its own device API key (it starts with wpk_) under WAservix -> Devices.
Create an account at https://tekservix.com/waservix/. API reference:
https://tekservix.com/waservix/docs/.
Details
Start with waservix_client(), then call the other waservix_* functions.
Every call returns the data part of the API answer as a list. API errors
are raised as conditions of class waservix_error, which carry the HTTP
status, the API message and the raw body.
Author(s)
Maintainer: Joseph Niyogushimwa niyogushimwaj967@gmail.com
Authors:
Joseph Niyogushimwa niyogushimwaj967@gmail.com
Other contributors:
Tekservix [copyright holder, funder]
See Also
Useful links:
Report bugs at https://github.com/TekservixHQ/waservix-r/issues
Create a WAservix client
Description
Create a WAservix client
Usage
waservix_client(
key = Sys.getenv("WASERVIX_API_KEY"),
base_url = "https://tekservix.com/waservix/api"
)
Arguments
key |
The device API key of your WhatsApp number (starts with |
base_url |
API base URL. Change it only for tests or a proxy. |
Value
An object of class waservix_client, used by every other function.
Examples
client <- waservix_client("wpk_your_device_key")
Delete a message for everyone
Description
Delete a message for everyone
Usage
waservix_delete_message(client, message_id)
Arguments
client |
A client from |
message_id |
Message ID. |
Value
The API confirmation.
Examples
## Not run:
waservix_delete_message(waservix_client("wpk_your_device_key"), 5473)
## End(Not run)
Edit a sent text
Description
WhatsApp allows edits for about 15 minutes after sending.
Usage
waservix_edit_message(client, message_id, text)
Arguments
client |
A client from |
message_id |
Message ID. |
text |
The new text. |
Value
The API confirmation.
Examples
## Not run:
waservix_edit_message(waservix_client("wpk_your_device_key"), 5473, "Corrected text")
## End(Not run)
Get one contact
Description
Get one contact
Usage
waservix_get_contact(client, phone)
Arguments
client |
A client from |
phone |
Phone number in international format. |
Value
The contact.
Examples
## Not run:
waservix_get_contact(waservix_client("wpk_your_device_key"), "+250788123456")
## End(Not run)
Get a group's details
Description
Get a group's details
Usage
waservix_get_group_metadata(client, group_id)
Arguments
client |
A client from |
group_id |
Group ID, ending in |
Value
The group's name, participants and settings.
Examples
## Not run:
waservix_get_group_metadata(waservix_client("wpk_your_device_key"),
"120363000000000000@g.us")
## End(Not run)
Get a sent message's status
Description
Get a sent message's status
Usage
waservix_get_message_info(client, message_id)
Arguments
client |
A client from |
message_id |
Message ID. |
Value
The message and its status (queued, sent, delivered, read, played or failed).
Examples
## Not run:
waservix_get_message_info(waservix_client("wpk_your_device_key"), 5473)
## End(Not run)
Get your number's connection status
Description
Get your number's connection status
Usage
waservix_get_status(client)
Arguments
client |
A client from |
Value
The connection status of the number behind the API key.
Examples
## Not run:
waservix_get_status(waservix_client("wpk_your_device_key"))
## End(Not run)
List contacts
Description
List contacts
Usage
waservix_list_contacts(client)
Arguments
client |
A client from |
Value
A list of your number's contacts.
Examples
## Not run:
waservix_list_contacts(waservix_client("wpk_your_device_key"))
## End(Not run)
List groups
Description
List groups
Usage
waservix_list_groups(client)
Arguments
client |
A client from |
Value
The groups your number is in; IDs end in @g.us.
Examples
## Not run:
waservix_list_groups(waservix_client("wpk_your_device_key"))
## End(Not run)
Check whether a number uses WhatsApp
Description
Check whether a number uses WhatsApp
Usage
waservix_on_whatsapp(client, phone)
Arguments
client |
A client from |
phone |
Phone number in international format. |
Value
A list telling whether the number is on WhatsApp.
Examples
## Not run:
waservix_on_whatsapp(waservix_client("wpk_your_device_key"), "+250788123456")
## End(Not run)
Call any WAservix endpoint
Description
Low-level access for endpoints that have no helper of their own.
Usage
waservix_request(client, method, path, body = NULL, query = NULL)
Arguments
client |
A client from |
method |
HTTP method, e.g. |
path |
Path after the base URL, e.g. |
body |
Optional list sent as JSON. |
query |
Optional named list of query parameters. |
Value
The data part of the API answer, as a list.
Examples
## Not run:
client <- waservix_client("wpk_your_device_key")
waservix_request(client, "GET", "/status")
## End(Not run)
Resend a failed message
Description
Resend a failed message
Usage
waservix_resend_message(client, message_id)
Arguments
client |
A client from |
message_id |
Message ID. |
Value
The new send attempt.
Examples
## Not run:
waservix_resend_message(waservix_client("wpk_your_device_key"), 5473)
## End(Not run)
Send a document
Description
Send a document
Usage
waservix_send_document(client, to, url, file_name = NULL, caption = NULL)
Arguments
client |
A client from |
to |
Phone number in international format, or a group ID. |
url |
Public URL of the file. |
file_name |
Optional file name shown to the recipient. |
caption |
Optional caption. |
Value
A list with the queued message ID and status.
Examples
## Not run:
waservix_send_document(waservix_client("wpk_your_device_key"), "+250788123456",
"https://example.com/inv-1042.pdf",
file_name = "Invoice-1042.pdf", caption = "Your invoice")
## End(Not run)
Send an image
Description
Send an image
Usage
waservix_send_image(client, to, url, caption = NULL)
Arguments
client |
A client from |
to |
Phone number in international format, or a group ID. |
url |
Public URL of the image. |
caption |
Optional caption. |
Value
A list with the queued message ID and status.
Examples
## Not run:
waservix_send_image(waservix_client("wpk_your_device_key"), "+250788123456",
"https://example.com/catalogue.jpg", caption = "New arrivals")
## End(Not run)
Send a location pin
Description
Send a location pin
Usage
waservix_send_location(client, to, latitude, longitude, name = NULL)
Arguments
client |
A client from |
to |
Phone number in international format, or a group ID. |
latitude, longitude |
Coordinates in decimal degrees. |
name |
Optional place name. |
Value
A list with the queued message ID and status.
Examples
## Not run:
waservix_send_location(waservix_client("wpk_your_device_key"), "+250788123456",
-1.9441, 30.0619, name = "Our shop")
## End(Not run)
Send any WhatsApp message
Description
Sends to a number ("+250788123456") or a group ID (ending in @g.us).
Field names follow the API: text, imageUrl, videoUrl, audioUrl,
documentUrl, fileName, location, poll, replyTo, mentions,
viewOnce.
Usage
waservix_send_message(client, to, ...)
Arguments
client |
A client from |
to |
Phone number in international format, or a group ID. |
... |
Message fields, named as in the API. |
Value
A list with the queued message ID and status.
Examples
## Not run:
client <- waservix_client("wpk_your_device_key")
waservix_send_message(client, "+250788123456",
videoUrl = "https://example.com/demo.mp4", text = "Demo")
## End(Not run)
Send a text message
Description
Send a text message
Usage
waservix_send_text(client, to, text)
Arguments
client |
A client from |
to |
Phone number in international format, or a group ID. |
text |
The message text. |
Value
A list with the queued message ID and status.
Examples
## Not run:
waservix_send_text(waservix_client("wpk_your_device_key"),
"+250788123456", "Your order #1042 has shipped.")
## End(Not run)
Verify a webhook delivery
Description
Compares the X-Webhook-Signature header with your number's webhook
secret. The comparison takes the same time whether or not they match.
Usage
waservix_verify_webhook(signature, secret)
Arguments
signature |
Value of the |
secret |
Your number's webhook secret. |
Value
TRUE when the header matches the secret, otherwise FALSE.
Examples
waservix_verify_webhook("my-secret", "my-secret")
waservix_verify_webhook("wrong", "my-secret")