Learn R Programming

evolution (version 0.0.1)

send_contact: Send a WhatsApp contact (auto-generate wuid as @s.whatsapp.net)

Description

Sends one or more contacts following the Evolution API v2 format. Automatically generates the wuid field as <digits>@s.whatsapp.net from each contact's phone number (or from number if not provided).

Usage

send_contact(client, number, contact, verbose = FALSE)

Value

Parsed JSON response as list (see .evo_post() for details).

Arguments

client

An evo_client() object.

number

Recipient number (E.164, e.g. "+55819...").

contact

Either:

  • a named list with fields fullName, phoneNumber, organization, email, url; or

  • a list of such lists (to send multiple contacts). The wuid field will be auto-generated if missing.

verbose

Logical; if TRUE, shows detailed logs (cli + httr2 verbose).

Examples

Run this code
if (FALSE) {
send_contact(
  client,
  number = "+55819...",
  contact = list(
    fullName = "Your Name",
    phoneNumber = "+55819...",
    organization = "Company Name",
    email = "andre@example.com",
    url = "https://company_site.tec.br"
  ),
  verbose = TRUE
)
}

Run the code above in your browser using DataLab