Learn R Programming

whapi (version 0.0.2)

whapi_check_health: Check Whapi.Cloud channel health and status

Description

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
)

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 in resp.

Arguments

wakeup

Logical(1). If TRUE, adds wakeup=true query 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.

Examples

Run this code
if (FALSE) {
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")
}

Run the code above in your browser using DataLab