Sending an SMS using the PHP/HTTP API

  1. <?php 
  2. /* Include PanaceaApi class */
  3. require_once("panacea_api.php");
  4.  
  5. $api new PanaceaApi();
  6. $api->setUsername("demouser");
  7. $api->setPassword("demouser");
  8.  
  9. $result $api->message_send("27111234567""Hello""27111236846");
  10.  
  11. if($api->ok($result)) {
  12.     echo "Message sentID was {$result['details']}\n";    
  13. else {
  14.     /* There was an error */
  15.     echo $api->getError();
  16. }
  17.  
  18. ?>