PHP code example of kudinovfedor / sms-club-json

1. Go to this page and download the library: Download kudinovfedor/sms-club-json 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/ */

    

kudinovfedor / sms-club-json example snippets


$manager = new \KudinovFedor\SmsClubJSON\SmsManager([
    'token' => 'token', // Token of the user account (which can be obtained in your account in the "Profile" section)
    'from'  => 'from' // Alpha name from which to send
]);

// or
$manager = new \KudinovFedor\SmsClubJSON\SmsManager();
$manager->setToken('token');
$manager->setFrom('from');

$manager->setTo(['380989361131', '380989361130'])
$manager->setMessage('Your message');
$response = $manager->send();

[
    "info": [
        "107": "380989361131"
    ],
    "add_info": [
        "380989361130": "Данный номер находится в черном списке"
    ]
]

$status = $manager->getStatus(['106', '107']);
// or
$manager->setSmsIds(['106', '107']);
$status = $manager->getStatus();

[
    "106": "ENROUTE",
    "107": "REJECTD"
]

$balance = $manager->getBalance();

[
    "money": "8111.1700",
    "currency": "UAH"
]

$originator = $manager->getOriginator();

[
    [0] => "test1",
    [1] => "test2"
]

if ($manager->hasErrors()) {
    $response = $manager->getErrors();
}