Skip to content

velostazione/besms

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BeSMS

Latest Version on Packagist test PHP 8.0.10

The unofficial helper library to send SMS with BeSMS.it

Installation

composer require velostazione/besms

Usage

See BeSMS official documentation: https://www.besms.it/documentazione_api/Documentazione_BCP_API.pdf

require_once('vendor/autoload.php');

use Velostazione\BeSMS\Client;
use Velostazione\BeSMS\Api;

$client = new Client();
$besms = new BeSMS($client, '<USERNAME>', '<PASSWORD>', <API_ID>, <REPORT_TYPE>, <SENDER>);

Send SMS

$response = $besms->send('61491570156', 'hello world'); 
    
print_r($response);

Different seder

Beside the sender defined when instantiating the class, a different sender can be specified on the fly upon sending a message:

$response = $besms->send('61491570156', 'hello world', <SENDER>); 
    
print_r($response);

Country code

Since BeSMS only accepts integer recipients, country codes in the common forms of +93, 0093 or +1-684 would not be accepted.

The send method will take care of this automatically removing any leading plus, double zero or dash.

View credit

$response = $besms->getCredit();

print_r($response);

Tests

./vendor/bin/phpunit tests

About

Simple PHP client to send SMS via BeSMS API

Resources

Stars

Watchers

Forks

Packages

 
 
 

Languages