<?php
/* Include PanaceaApi class */
require_once("panacea_api.php");
$api->setUsername("demouser");
$api->setPassword("demouser");
if($api->ok($groups)) {
foreach($groups['details'] as $group) {
echo "Group {$group['name']} has ID {$group['id']}\n";
}
}
/* Let's add a new group */
if($api->ok($result)) {
echo "Group added! ID = {$result['details']}\n";
/* Now let's add some contacts to our group */
$contact1 =
$api->address_book_contact_add($result['details'], "441234567"); /* Remember to specify the group ID, first name and last name are optional parameters */
if($api->ok($contact1) && $api->ok($contact2)) {
echo "Both contacts added successfully, IDs {$contact1['details']} and {$contact2['details']}\n";
/* Let's set the surname for contact2 */
}
/* Let's list all the contacts now */
/* Let's delete this group now */
}
?>