PHP code example of uguranyum / yii2-zadarma-sms

1. Go to this page and download the library: Download uguranyum/yii2-zadarma-sms 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/ */

    

uguranyum / yii2-zadarma-sms example snippets


$params = [
    'number' => 'YOUR PHONE NUMBER',
    'message' => 'PLEASE WRITE YOUR MESSAGE HERE',
];

$zadarma    = new Zadarma("ZADARMA API KEY", "ZADARMA API SECRET");
$answer     = $zadarma->call('/v1/sms/send/', $params, 'post');
$answerObject = json_decode($answer);
print_r($answerObject);

$params = array(
    'start' => '2015-01-01 00:00:00',
    'end' => '2015-01-31 00:00:00',
    /*'sip' => 'YOURSIP',*/
    /*'cost_only' => true,*/
    /*'type' => 'toll'*/
);
$zadarma    = new \Zadarma_API\Client(KEY, SECRET);
$answer     = $zadarma->call('/v1/statistics/', $params);
$answerObject = json_decode($answer);