PHP code example of adedaramola / sendchamp-php-sdk

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

    

adedaramola / sendchamp-php-sdk example snippets




dedaramola\Sendchamp\Sendchamp;

// For production environment, provide "live" as second argument
$sendchamp = new Sendchamp('api-public-key');

// Send sms
$sendchamp->sms()->send([
    'to' => ['+2348132644971'],
    'message' => 'This package is awesome',
    'sender_name' => 'Adedaramola',
    'route' => 'dnd'
]);

// Get sms delivery report
$sendchamp->sms()->getDeliveryReport('9173hqhb7837ydg');

// Get bulk sms delivery report
$sendchamp->sms()->getBulkDeliveryReport('9173hqhb7837ydg');

// Send otp
$sendchamp->otp()->send([
    'channel' => '',
    'sender' => '',
    'token_type' => '',
    'token_length' => 6
]);

// Verify otp
$sendchamp->otp()->verify($reference, $code);

// Get wallet balance
$sendchamp->wallet()->getBalance();
bash
composer