To make it extremely easy for PHP developers to integrate with our API we provide a full PHP Class which enables you to easily integrate it into your existing application.
You can download the PHP class and examples here.
Please note PHP 5 with the cURL and JSON extensions available.
Once you have downloaded it, in the examples/ directory in the zip file are some basic examples for using our API.
An example (using our PHP class) to send a message can be seen below:
/* Include PanaceaApi class */
require_once("panacea_api.php");
$api = new PanaceaApi();
$api->setUsername("demouser");
$api->setPassword("demouser");
$result = $api->message_send("27111234567", "Hello", "27111234567");
if($api->ok($result)) {
echo "Message sent! ID was {$result['details']}\n";
} else {
/* There was an error */
echo $api->getError();
}
This class is based on the HTTP API.