PHP code example of codehub / sms-api

1. Go to this page and download the library: Download codehub/sms-api library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

codehub / sms-api example snippets




odeHub\SMS\Semaphore;

$semaphore = new Semaphore('{API_KEY}', '{SENDER_NAME}'); // Optional SENDER_NAME default to Semaphore

echo $semaphore->send('09123456789', 'Your message here');

echo $semaphore->send(['09123456789', '09987654321'], 'Your message here');

echo $semaphore->priority('09123456789', 'Your message here');

echo $semaphore->messages(['limit' => 100, 'page' => 3]);

echo $semaphore->messages(['startDate' => '0000-00-00', 'endDate' => '0000-00-00']);

echo $semaphore->messages(['network' => 'globe']);

echo $semaphore->messages(['status' => 'success']);

echo $semaphore->account();

echo $semaphore->transactions();

echo $semaphore->sendernames();

echo $semaphore->users();