tw_send_message: Send an SMS or MMS Message

Description Usage Arguments Value Examples

Description

Send an SMS or MMS Message

Usage

1
tw_send_message(to, from, body = NULL, media_url = NULL)

Arguments

to

A phone number which will receieve the message.

from

A phone number which will send the message.

body

The body of the message.

media_url

A url containing media to be sent in a message.

Value

A twilio_message object.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
## Not run: 

# Set API credentials
# You only need to do this once per R session
Sys.setenv(TWILIO_SID = "M9W4Ozq8BFX94w5St5hikg7UV0lPpH8e56")
Sys.setenv(TWILIO_TOKEN = "483H9lE05V0Jr362eq1814Li2N1I424t")

# Send a simple text message
tw_send_message("2125557634", "9178675903", "Hello from R!")

# Send a picture message
tw_send_message("2125557634", "9178675903", media_url = "https://www.r-project.org/logo/Rlogo.png")

# Send a picture message with text
tw_send_message("2125557634", "9178675903", "Do you like the new logo?",
    "https://www.r-project.org/logo/Rlogo.png")


## End(Not run)

seankross/twilio documentation built on May 29, 2019, 4:55 p.m.