This module simplifies sending SMS through the Nexmo API.
use Nexmo::SMS::GetBalance; my $nexmo = Nexmo::SMS::GetBalance->new( server => 'http://rest.nexmo.com/sms/json', username => 'testuser1', password => 'testpasswd2', ); my $balance = $sms->get_balance;
create a new object
my $object = Nexmo::SMS::GetBalance->new( server => 'http://rest.nexmo.com/sms/json', username => 'testuser1', password => 'testpasswd2', );
This method recognises these parameters:
server => 'required', username => 'required', password => 'required',
Getter/setter for the user_agent attribute of the object. By default a new object of LWP::UserAgent is used, but you can use your own class as long as it is compatible to LWP::UserAgent.
$sms->user_agent( MyUserAgent->new ); my $ua = $sms->user_agent;
This actually calls the Nexmo SMS API. It returns the balance of the account.
my $balance = $object->get_balance;
These attributes are available for Nexmo::SMS::GetBalance objects. For each attribute there is a getter/setter:
Nexmo::SMS::GetBalance
$nexmo->server( 'servername' ); my $server = $nexmo->server;
password
server
username
To install Nexmo::SMS, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Nexmo::SMS
CPAN shell
perl -MCPAN -e shell install Nexmo::SMS
For more information on module installation, please visit the detailed CPAN module installation guide.