Skip to content

Instantly share code, notes, and snippets.

Created September 25, 2015 15:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/586c851a1f87a05a1162 to your computer and use it in GitHub Desktop.
Save anonymous/586c851a1f87a05a1162 to your computer and use it in GitHub Desktop.
<?php
require '../src/Osms.php';
use \Osms\Osms;
//$config = array(
// 'token' => 'your_access_token'
//);
$config = array(
'clientId' => 'clientID',
'clientSecret' => 'clientSecret'
);
$osms = new Osms($config);
$osms->setVerifyPeerSSL(false);
// retrieve an access token
$response = $osms->getTokenFromConsumerKey();
echo $response['access_token'];
if (!empty($response['access_token'])) {
$senderAddress = 'tel:+22500000000';
$receiverAddress = 'tel:+22548348221';
$message = 'Hello World!';
$senderName = 'Optimus Prime';
$osms->sendSMS($senderAddress, $receiverAddress, $message, $senderName);
echo 'Done!';
} else {
echo $response['error'];
// error
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment