<?php require_once '../nasaramobileapiclient.php'; $phone = "233244209193"; $senderId = "Testing"; $message = "hey there, this is a test message!"; $smsApi = new NasaraMobileApiClient("9EEPC38Eyf9N6Mc8beMEH"); $result = $smsApi->sendSms($phone, $senderId, $message); if ($result == '1801') { echo "message sent successfully"; } elseif ($result == '1802') { echo "message sending failed"; } elseif ($result == '1803') { echo "invalid login phone or password given"; } elseif ($result == '1804') { echo "not enough sms credit"; } elseif ($result == '1805') { echo "sender id must be more than 1 character and less than 12 characters"; } elseif ($result == '1806') { echo "phone number must be more than 8 characters"; }
<?php require_once '../nasaramobileapiclient.php'; $smsApi = new NasaraMobileApiClient("9EEPC38Eyf9N6Mc8beMEH"); $response = $smsApi->fetchContacts(); print_r($response);
<?php require_once '../nasaramobileapiclient.php'; $phoneNumbers = "233xxxxxxxxx, 24342xxxxxx"; $groups = ""; $contactIds = ""; $senderId = "NTesting"; $message = "hey there, this is a test message!"; $smsApi = new NasaraMobileApiClient("9EEPC38Eyf9N6Mc8beMEH"); $response = $smsApi->sendSmsVersionTwo($phoneNumbers, $senderId, $message); $response = json_decode($response);
<?php require_once '../nasaramobileapiclient.php'; $smsApi = new NasaraMobileApiClient("9EEPC38Eyf9N6Mc8beMEH"); $response = json_decode($smsApi->fetchContactDetails(337)); print_r($response->data->contact);
<?php require_once '../nasaramobileapiclient.php'; $smsApi = new NasaraMobileApiClient("9EEPC38Eyf9N6Mc8beMEH"); $result = $smsApi->checkCredit(); switch ($result) { case '1903': echo "there was an error <br>"; break; case '1902': echo "this api key does not exist <br>"; break; case '1901': echo "Api key must be posted to execute request <br>"; break; default: $result = json_decode($result); echo $credit = $result->data; break; }