php - twilio from number required -


trying basic function using twilio , have come across problem. wants number, though have supplied it. thoughts?

<?php require_once('services/twilio.php');  $twilionumber = "somevalidnumber"; $dest = "somevaliddestination";  $accountsid = "validsid"; $authtoken = "validtoken";  $client = new services_twilio($accountsid, $authtoken);  try {     $message = $client->account->messages->create(     $twilionumber,     $dest,     "hello world!");  } catch (services_twilio_restexception $e) { echo $e->getmessage(); } 

?>

results in:

php warning:  invalid argument supplied foreach() in /var/www/html/sms/services/twilio.php on line 248 'from' phone number required. 

the docs bit misleading. change

account->messages->create 

to

account->messages->sendmessage 

and works fine.


Comments

Popular posts from this blog

database - VFP Grid + SQL server 2008 - grid not showing correctly -

jquery - Set jPicker field to empty value -

.htaccess - htaccess convert request to clean url and add slash at the end of the url -