PHP code example of kyasms / php-api

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

    

kyasms / php-api example snippets




use Kyasms\PhpApi\kyasmsClient;

$kyasms = new kyasmsClient();

// set apikey and clientid
$kyasms->setClient('APIKEY', 'CLIENTID');

// Set sms data

$smsData = array(
          'from' => 'KYA SMS',
          'to' =>'22966413718,22998039720', 
          'type' => 0,
          'message' => 'api sms'                         
       );
           
       $response = $kyasms->sendSms($smsData);
       echo $response;
           

  $ composer