Calling Twilio API from R using RCurl -
i trying send sms through twilio using r. following code works after sending sms, tries keep connection option.
library(rcurl) twilio_account_sid <- "yourkey" twilio_account_token <- "yourtoken" number_from <- "+44*********" number_to <- "+44*********" the_url <- paste("https://api.twilio.com/2010-04-01/accounts/", twilio_account_sid,"/messages.xml",sep="") output <- postform(the_url, .opts = list( userpwd = paste(twilio_account_sid,":",twilio_account_token,sep=""), useragent = "rcurl", verbose = true ), .params = c(from = number_from, = number_to, body = "i sending test message" ) )
then message:
< connection: keep-alive < * connection #1 host api.twilio.com left intact error: unauthorized
do have idea solve issue?
Comments
Post a Comment