PHP code example of sevenymedia / bulksmscenter-http-api

1. Go to this page and download the library: Download sevenymedia/bulksmscenter-http-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/ */

    

sevenymedia / bulksmscenter-http-api example snippets




$client = new \BulkSmsCenter\Client(new \BulkSmsCenter\Auth(
    'YOUR_BULKSMSCENTER_USERNAME',
    'YOUR_BULKSMSCENTER_PASSWORD'
));

$message = new \BulkSmsCenter\Message([
    'body' => 'TEXT_MESSAGE',
    'recipient' => 'RECIPIENT_NUMBER',
    'sender' => 'SENDER_NUMBER',
]);

// Send a message
$credits = $client->sendMessage($message);

// Get a message status
$credits = $client->getMessageStatus($message->getId());

// Retrieve your remaining credits
$credits = $client->getBalance();