1. Go to this page and download the library: Download statum/statum-php-sdk 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/ */
statum / statum-php-sdk example snippets
use Statum\Sdk\StatumClient;
$client = StatumClient::create(
consumerKey: $_ENV['STATUM_CONSUMER_KEY'],
consumerSecret: $_ENV['STATUM_CONSUMER_SECRET']
);
use Statum\Sdk\StatumClient;
class SmsController extends Controller
{
public function __construct(private readonly StatumClient $client) {}
public function send() {
// Ready to make type-safe calls!
}
}
$response = $client->sms()->sendSms(
phoneNumber: '254721553678', // Recipient phone number in international format
senderId: 'STATUM', // Your approved Sender ID
message: 'Hello! This is a secure notification from Statum SDK.'
);
echo "Status Code: " . $response->statusCode . "\n";
echo "Description: " . $response->description . "\n";
echo "Request ID: " . $response->requestId . "\n";
$response = $client->airtime()->sendAirtime(
phoneNumber: '254721553678',
amount: '100' // Amount must be passed as a string representation
);
echo "Status Code: " . $response->statusCode . "\n";
echo "Description: " . $response->description . "\n";
echo "Request ID: " . $response->requestId . "\n";