A PHP library to access Orange SMS API.
Install Composer. Then, simply do:
$ composer require ismaeltoe/osms
You can load the class using Composer's autoloading:
require 'vendor/autoload.php';
Otherwise, you can simply require the file directly:
require_once 'path/to/Osms.php';
require 'vendor/autoload.php';
use \Osms\Osms;
$osms = new Osms('your_client_id', 'your_client_secret', 'your_access_token');
$senderAddress = 'tel:+22500000000';
$receiverAddress = 'tel:+22501010101';
$message = 'Hello World!';
$osms->sendSMS($senderAddress, $receiverAddress, $message);
For more examples, see examples.
When running your application in a local environment, you will get an SSL error. To make things work, set the peer's certificate checking option to false:
$osms = new Osms('your_client_id', 'your_client_secret', 'your_access_token', false);
But it should work on your hosting server, so enable the certificate checking when you are ready to deploy your application for security reasons.
Follow this link to know more about the Orange SMS API:
Released under the MIT License - see LICENSE.txt
for details.