PHP code example of tesark / msg91-php

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

    

tesark / msg91-php example snippets

sh
"      "tesark/msg91-php": "dev-master"
        }
sh
 GET
http://api.msg91.com/api/sendhttp.php?authkey=YourAuthKey&mobiles=919999999990,919999999999&message=message&sender=ABCDEF&route=4&country=0
sh
Tips 1:
$sample = [ 
    'message'      => 'WELCOME TO TESARK',
    'sender'       => 'UTOOWE',
    'country'      => 91,
    'flash'        => 1,
    'unicode'      => 1,
    'schtime'      => "2020-01-01 10:10:00",
    'response'     => "json",
    'afterminutes' => 10,
    'campaign'     => "venkat"
];
use Sender\PromotionalSms;
use Sender\TransactionalSms;

$sms = new PromotionalSms();
$sms->PromotionalSms("919******541,919******728",$sample);

$sms = new TransactionalSms();
$sms->sendTransactional("919******541,919******728",$sample);

Tips 2:
$sample = [ 
    'message'      => 'WELCOME TO TESARK',
    'sender'       => 'TOOME',
    'country'      => 91,
    'flash'        => 1,
    'unicode'      => 1,
    'schtime'      => "2020-01-01 10:10:00",
    'response'     => "json",
    'afterminutes' => 10,
    'campaign'     => "venkat"
];

use Sender\PromotionalSms;
use Sender\TransactionalSms;

$sms = new PromotionalSms();
$sms = new TransactionalSms();

$sms->sendTransactional(919******541,$sample);
$sms->PromotionalSms(919******541,$sample);

sh
GET
http://api.msg91.com/api/sendotp.php?authkey=YourAuthKey&mobile=919999999990&message=Your%20otp%20is%202786&sender=senderid&otp=2786
sh
http://api.msg91.com/api/retryotp.php?authkey=YourAuthKey&mobile=919999999990&retrytype=voice
sh
http://api.msg91.com/api/verifyRequestOTP.php?authkey=YourAuthKey&mobile=919999999990&otp=2786