Learn R Programming

evolution (version 0.0.1)

send_media: Send media (image, video, document) - robust for base64

Description

Send media (image, video, document) - robust for base64

Usage

send_media(
  client,
  number,
  mediatype,
  mimetype,
  caption = NULL,
  media,
  file_name,
  delay = NULL,
  link_preview = NULL,
  verbose = FALSE
)

Value

A named list parsed from the Evolution API JSON response. The list typically contains message metadata (IDs, timestamps, queue info), and any additional fields defined by the API for media messages. The HTTP status code is stored in attr(result, "http_status"). This return value represents the server acknowledgement of the media upload/send.

Arguments

client

An evo_client() object.

number

Character. Recipient in E.164 format (e.g., "+5581999...").

mediatype

One of "image", "video", "document".

mimetype

e.g., "image/png", "video/mp4", "application/pdf".

caption

Caption text (optional).

media

Can be: (a) HTTP/HTTPS URL; (b) raw base64 (no prefix); (c) base64 in the format data:*;base64,<…>; (d) local file path.

file_name

Suggested filename (consistent with the mimetype).

delay

Integer (ms). Optional presence delay before sending.

link_preview

Logical. Enable URL link preview.

verbose

Detailed log output (cli + req_verbose()).