PHP code example of irteel / irteelsms
1. Go to this page and download the library: Download irteel/irteelsms 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/ */
irteel / irteelsms example snippets
use IRTEELSMS\IRTEELSMSAPI;
use IRTEELSMS\IRTEELSMSAPI;
$token = '3|39VVNH7w6pTaNEUgnTzpcX1iDsmnulcqFyMBv3TR';
$sender_id = 'irteelSMS';
$recipient = '237695601314';
$recipient = '237695601314,8801721000000,880167000000,01913000000';
$url = 'https://my.irteelsms.com/api/v3';
$message = 'test message sender_id IRTEEL SMS V3';
The sms type (Plain,Voice,MMS,Wathsapp)
// Plain text SMS
$type = 'plain'; //For Plain text message
$schedule_time='2021-12-20 07:00'; //Time like this format: y-m/d h:mm
$message_body = array(
'recipient' => $recipient,
'sender_id' => $sender_id,
'message' => $message,
'type' => 'plain',
);
$message_body = array(
'recipient' => $recipient,
'sender_id' => $sender_id,
'message' => $message,
'type' => 'voice',
);
$message_body = array(
'recipient' => $recipient,
'sender_id' => $sender_id,
'message' => $message, //optional
'type' => 'mms',
'media_url'='https://via.placeholder.com/150.jpg'
);
$message_body = array(
'recipient' => $recipient,
'sender_id' => $sender_id,
'message' => $message,
'type' => 'Whathsapp',
);
$message_body = array(
'recipient' => $recipient,
'sender_id' => $sender_id,
'message' => $message,
'type' => $type,
'schedule_time' => $schedule_time
);
$client = new IRTEELSMS($url,$message_body,$token);
$response = $client->sms_send();
$client = new IRTEELSMS($url,'',$token);
$view_all_message=$client->sms_views();
$get_balance=$client->sms_balance();