dot-tw_get_phones: Purchase Twilio Phones Algorithmically

.tw_get_phonesR Documentation

Purchase Twilio Phones Algorithmically

Description

Intended use: Take a random sample of phones from the list you need to text. Use this function to actually purchase and add to an existing message service.

Usage

.tw_get_phones(
  phone,
  locality = NA,
  state = NA, 
  project, 
  max_dist, 
  msgsvc_sid, 
  sid = Sys.getenv('TWILIO_ACCOUNT_SID'),
  key = Sys.getenv('TWILIO_KEY'),
  secret = Sys.getenv('TWILIO_SECRET'),
  progress=FALSE, verbose=FALSE)

Arguments

phone

Single phone number to match, 10 digit (2025555555) or 12 digit (+12025555555), or 3-digit area code. TODO: Other formats.

locality

Optional vector of localities, as a supplement or alternative to providing phones/area codes.

state

Optional vector of states — if state is supplied & twilio's response phone is out of state, phone will not be purchased.

max_dist

Maximum search distance from provided phone

sid

twilio credentials: Account SID.

key

twilio credentials: Account user key.

secret

twilio credentials: User secret. Don't store this in scripts!!!

progress

Show progress bar — disabled by default when this is used outside context of tw_get_phones().

verbose

For error diagnosis.

project

Project name—either "Working America" or "Mercury Opinion". Will be incorporated into phone Friendly Name.

msgsvc_sid

The message service SID to add the phone to.

Examples


## Not run: 
source("C:/Users/lwolberg/Desktop/.ssh/twilio_auth.R")

# NOTE: you could use the internal function that takes a single phone at a time 
# if you wanted to, for some reason.
.tw_get_phones <- function(phone, state, project, msgsvc_sid, sid, key, secret)


## End(Not run)

workingamerica/twilio documentation built on Jan. 30, 2024, 4:55 p.m.