Octopush SMS API PHP client.
The recommended way to install Octopush SMS API PHP client is through composer:
$ composer require octopush/sms-api
<?php
$client = new Octopush\Api\Client('*****@example.com', '***API_KEY***');
$client->setSmsRecipients(['+336********']);
$client->setSmsSender('AnySender');
$client->send('Octopush - Send SMS like a PRO.');
array:9 [
"error_code" => "000"
"cost" => "0.049"
"balance" => "0"
"sending_date" => "1455291116"
"number_of_sendings" => "1"
"currency_code" => "€"
"successs" => array:1 [
"success" => array:4 [
"recipient" => "+336*******"
"country_code" => "FR"
"cost" => "0.049"
"sms_needed" => "1"
]
]
"failures" => []
]
For more information see documentation.
<?php
$client = new Octopush\Api\Client('*****@example.com', '***API_KEY***');
$client->setSmsRecipients(['+336********']);
$client->setSmsSender('AnySender');
$client->setWithReplies();
$client->send('Octopush - Send SMS like a PRO.');
For more information see documentation.
<?php
$client = new Octopush\Api\Client('*****@example.com', '***API_KEY***');
$client->getCredit();
array:2 [
"error_code" => "000"
"credit" => "0.18"
]
For more information see documentation.
You can find working examples in examples
directory.
Before running them, make sure to configure them by editing config.php
file:
$ cp config.php.dist config.php