PHP code example of ochui / d7sms

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

    

ochui / d7sms example snippets



$aPIUsername = 'aPIUsername'; // API Key
$aPIPassword = 'aPIPassword'; // API Token

$client = new D7SMSLib\D7SMSClient($aPIUsername, $aPIPassword);

$client = $client->getClient();

function getBalance()


$client->getBalance();


function createSendSMS($options)

$body = new SendSMSRequest();
$collect['body'] = $body;

$contentType = 'Content-Type';
$collect['contentType'] = $contentType;

$accept = 'Accept';
$collect['accept'] = $accept;


$client->createSendSMS($collect);


function createBulkSMS(
        $body,
        $contentType,
        $accept)

$bodyValue = "{  \"messages\": [    {      \"to\": [        \"971562316353\",        \"971562316354\",        \"971562316355\"      ],      \"content\": \"Same content goes to three numbers\",      \"from\": \"SignSMS\"    }  ]}";
$body = APIHelper::deserialize($bodyValue);
$contentType = 'application/json';
$accept = 'application/json';

$client->createBulkSMS($body, $contentType, $accept);

autoload.php