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
Post a Comment