if (FALSE) {
Sys.setenv(WHAPI_TOKEN = "your_token_here")
whapi_send_document("5581999999999", "report.pdf", type="file", caption="Monthly report")
whapi_send_document("5581999999999", "https://example.com/contract.docx", type="url")
b <- openssl::base64_encode(readBin("memo.odt","raw",file.info("memo.odt")$size))
du <- sprintf("data:application/vnd.oasis.opendocument.text;name=%s;base64,%s",
basename("memo.odt"), b)
whapi_send_document("5581999999999", du, type="base64")
}
Run the code above in your browser using DataLab