PHP code example of smsplateform / php

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

    

smsplateform / php example snippets




use Smsplateform\Client\Auth;
use Smsplateform\Client\Request;

Auth::Init('<YOUR_USERNAME>', '<YOUR_PASSWORD>');
$sms = new Request([
	"sender" 		=> '<SENDER>',
	"msisdn" 		=> '<PHONE>',
	"message" 		=> '<MESSAGE>',

	'webhook_url' 	=> 'https://your-site/script.php'
]);

$result = $sms->Send();
$data = $result->getResponse();

var_dump($data);

use Smsplateform\Client\Auth;
use Smsplateform\Client\Request;

Auth::Init('<YOUR_USERNAME>', '<YOUR_PASSWORD>');
$sms = new Request([]);

$result = $sms->List();
$data = $result->getResponse();

var_dump($data);

use Smsplateform\Client\Auth;
use Smsplateform\Client\Request;

Auth::Init('<YOUR_USERNAME>', '<YOUR_PASSWORD>');
$sms = new Request([]);

$result = $sms->Profile();
$data = $result->getResponse();

var_dump($data);

use Smsplateform\Client\Auth;
use Smsplateform\Client\Request;

Auth::Init('<YOUR_USERNAME>', '<YOUR_PASSWORD>');
$sms = new Request([
	"message_id" 	=> '<SMS_ID>'
]);

$result = $sms->View();
$data = $result->getResponse();

var_dump($data);