SMS campaign reports or major statistical data of SMS campaign are obtained. In order to obtain more detailed data, additional functions have to be used.
smsCampaignStats(string $cid) : array
SMS campaign statistics is represented as an array that includes:
smsCampaignStats($cid); header("Content-Type: text/plain"); if ($api->errorCode){ echo "Unable to load smsCampaignStats()!"; echo "\tCode=".$api->errorCode."\n"; echo "\tMsg=".$api->errorMessage."\n"; } else { echo "Stats for ".$cid."\n"; foreach($retval as $k=>$v){ echo "\t".$k." => ".$v."\n"; } }
List of links on which receivers have clicked is obtained, as well as the number of total clicks and unique clicks.
smsCampaignClickStats(string $cid) : struct
Array of links. Each link is stored as a key of resulting array and its corresponding value is an array consisting of:
smsCampaignClickStats($cid); header("Content-Type: text/plain"); if ($api->errorCode) { echo "Unable to load smsCampaignClickStats()!"; echo "\tCode=" . $api->errorCode . "\n"; echo "\tMsg=" . $api->errorMessage . "\n"; } else { if (sizeof($retval) == 0) { echo "No stats for this sms campaign yet!\n"; } else { foreach ($retval as $url => $detail) { echo "URL: " . $url . "\n"; echo "\tClicks = " . $detail['clicks'] . "\n"; echo "\tUnique Clicks = " . $detail['unique'] . "\n"; } } }
Messages are received from SMS recipient phone carrier in cases SMS was not delivered. Phone list with additional parameters is returned.
smsCampaignBounces(string $cid, integer $start, integer $limit) : array
Array of bounce messages. Each message is represented as an array that includes:
smsCampaignBounces($cid, $start, $limit); header("Content-Type: text/plain"); if ($api->errorCode){ echo "Unable to load smsCampaignBounces()!"; echo "\tCode=".$api->errorCode."\n"; echo "\tMsg=".$api->errorMessage."\n"; } else { echo "SMS not delivered: ". sizeof($retval). "\n"; foreach($retval as $msg){ echo $msg['phone']."\n"; echo $msg['reason']."\n\n"; } }