Sending an SMS using the PHP/HTTP API

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