1. Go to this page and download the library: Download rootscratch/sms 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/ */
rootscratch / sms example snippets
use Rootscratch\SMS\Configuration;
$configuration = new Configuration();
// Set API Key
$configuration->setApiKey('your_api_key');
/**
* Configuration
*
* Get Devices = getDevices()
* Get Balance = getBalance()
*
* Get Message By ID = getMessageByID($id) : if $id int = message id, if $id string = group id
*
* Get Message By Status = getMessagesByStatus($status, $deviceID = null, $simID = null, $time = null, $endTimestamp = null)
* Get messages "received" on SIM 1 of device ID 8 in last 24 hours = getMessagesByStatus("Received", 8, 0, time() - 86400)
*
* Get USSD Request By ID = getUssdRequestByID($id)
* Get USSD requests with request text "*150#" sent in last 24 hours. = getUssdRequests("*150#", null, null, time() - 86400)
*
* Add a new contact to contacts list 1 or resubscribe the contact if it already exists. = addContact(1, "+11234567890", "Test", true);
* Unsubscribe a contact using the mobile number. = unsubscribeContact(1, "+11234567890");
*
*/
echo json_encode($configuration->getDevices(), JSON_PRETTY_PRINT);
use Rootscratch\SMS\Send;
$sendMessage = new Send();
$send_single = $sendMessage->sendSingleMessage('mobile_number', 'Message');
echo json_encode($send_single, JSON_PRETTY_PRINT);