if (FALSE) {
# Sys.setenv(WHAPI_TOKEN = "your_token_here")
whapi_send_image("5581999999999", image = "card.png", type = "file", caption = "Card")
whapi_send_image("5581999999999", image = "https://site.com/img.png", type = "url")
b64 <- openssl::base64_encode(readBin("card.png","raw",file.info("card.png")$size))
data_uri <- sprintf("data:image/png;name=%s;base64,%s", basename("card.png"), b64)
whapi_send_image("5581999999999", image = data_uri, type = "base64")
}
Run the code above in your browser using DataLab