Fetches profile information for one or more contacts using
GET /contacts/{ContactID}/profile and returns a tidy tibble.
This version assumes the response body contains:
name(string, user name),about(string, user info in About section),icon(string, profile preview icon URL),icon_full(string, full avatar URL).
Usage
whapi_get_contact_profile(
contacts,
token = Sys.getenv("WHAPI_TOKEN", unset = ""),
full = TRUE,
timeout = 30,
verbose = TRUE
)Arguments
- contacts
Character vector. Phones in E.164 digits (no "+") or chat IDs.
- token
Bearer token. Defaults to env var
WHAPI_TOKEN.- full
Logical. If
TRUE, add_full=truequery param. DefaultTRUE.- timeout
Numeric. Request timeout (seconds). Default
30.- verbose
Logical. Print progress with cli? Default
TRUE.
Value
A tibble with one row per contact:
contact_id(input id or JID as queried),name,about,icon,icon_full,respwith the raw response (list).
Details
Each
contactselement may be a phone number (free text) or a JID (e.g.,"1203...@g.us"). Phone numbers are normalized viawhapi_normalize_to()(12 digits total); JIDs are kept as-is.When
full = TRUE,_full=trueis added to the querystring to request higher-resolution avatars (if supported).
