PHP code example of igormakarov / kyivstar.sms.api.php.client

1. Go to this page and download the library: Download igormakarov/kyivstar.sms.api.php.client 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/ */

    

igormakarov / kyivstar.sms.api.php.client example snippets




use igormakarov\KyivstarSms\Exceptions\UnauthorizedException;
use igormakarov\KyivstarSms\KyivstarAuth;
use igormakarov\KyivstarSms\KyivstarSmsClient;
use igormakarov\KyivstarSms\Message;

KyivstarSmsClient($url, $accessToken['access_token']);
    $msgId = $client->sendSms(new Message("messagedesk", "+380679000000", "це тест"));
    $status = $client->deliveryStatusSms($msgId);
    var_dump($status);
} catch (Exception $ex) {
    var_dump("code ", $ex->getCode());
    var_dump("message ", $ex->getMessage());
}