PHP code example of taqnyat / php

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

    

taqnyat / php example snippets




$status = $taqnyt->sendStatus();
print $status;


$bearer = '**************************0adc2b';
$taqnyt = new TaqnyatSms($bearer);


$balance = $taqnyt->balance();
print $balance;


$bearer = '**************************0adc2b';
$taqnyt = new TaqnyatSms($bearer);


$senders = $taqnyt->senders();
print $senders;

// Sending a SMS using Taqnyat API and PHP is easy as the following:

$bearer = '**************************0adc2b';
$taqnyt = new TaqnyatSms($bearer);

$body = 'message Content';
$recipients = ['966********'];
$sender = 'Sender Name';
$smsId = '25489';

$message =$taqnyt->sendMsg($body, $recipients, $sender, $smsId);
print $message;

// Sending a SMS using Taqnyat API and PHP is easy as the following:

$bearer = '**************************0adc2b';
$taqnyt = new TaqnyatSms($bearer);

$body = 'message Content';
$recipients = ['966********'];
$sender = 'Sender Name';
$smsId = '';
$schedule = '2020-09-30T14:26';
$deleteId = 100;

$message = $taqnyt->sendMsg($body, $recipients, $sender, $smsId, $scheduled, $deleteId);
print $message;

composer