Calls GET /health to retrieve channel status, versions,
uptime, device, IP, and user info.
Usage
whapi_check_health(
wakeup = TRUE,
channel_type = c("web", "mobile"),
token = Sys.getenv("WHAPI_TOKEN", unset = ""),
timeout = 30,
verbose = TRUE
)Arguments
- wakeup
Logical(1). If TRUE, adds
wakeup=truequery param. Default: TRUE.- channel_type
Character(1). Channel type, either
"web"or"mobile". Default:"web".- token
Character(1). Bearer token. Defaults to env var
WHAPI_TOKEN.- timeout
Numeric(1). Request timeout (s). Default 30.
- verbose
Logical(1). Print CLI logs? Default TRUE.
Value
A tibble with key health information:
channel_id,uptime,version,core_version,api_version,device_id,ip,status_code,status_text,user_id,user_name,user_pushname,is_business,profile_pic,profile_pic_full,user_status, plus the raw response inresp.
Examples
if (FALSE) { # \dontrun{
Sys.setenv(WHAPI_TOKEN = "your_token_here")
# Default check (wakeup=TRUE, channel_type="web")
whapi_check_health()
# Check with channel_type = "mobile"
whapi_check_health(channel_type = "mobile")
} # }
