SMS::Matrix - Module for the SMSMatrix API!
version 1.00
This module simplifies sending SMS through the SMSMatrix API.
use SMS::Matrix; use Data::Dumper; my $x = SMS::Matrix->new ( username => 'myaccount@qqqqq.com', password => 'mypassword', ); my $resp = $x->send_sms ( txt => 'This is a test', phone => '13475524523', ); print $x->status() . "\n" . ## Numbers from 200-399 mean success; numbers from 400 up mean error $x->errstr() . "\n" . ## If ok, set to 'OK' "Response" . Dumper ($resp) . "\n\n"; ## resp hash looks like this: ## { ## 'ID' => '03ade5c5ede29451edd75147aa9586d0', ## 'STATUSTXT' => 'OK', ## 'STATUSCODE' => 200, ## 'TIMESTAMP' => 1409596234 ## UTC ## }; ## resp may be undefined, if API didn't even hit the SMS Gateway server
Version 1.00
create a new object
my $x = SMS::Matrix->new ( username => 'myaccount@qqqqq.com', password => 'mypassword', );
Username and password are not validated at this point.
Send new sms message, returns response object or undef.
undef
my $resp = $x->send_sms ( txt => 'This is a test', phone => '13475524523', ## Always use country prefix (e.g 1 for US/Canada) ); print Data::Dumper ($resp);
returns 1 if message was sent OK
print $x->is_success();
returns 1 if message was NOT sent OK
print $x->is_error();
gets/set status of the message
print $x->status();
gets value of the username property
print $x->username();
gets value of the password property
print $x->password();
returns the "last" error as string.
print $x->errstr();
Retrieves your current balance - number of credits available for your account
my $resp = $x->get_balance(); print Data::Dumper ($resp);
Internal function, do not use it. Its interface may change in the future.
Send new tts (text to speech) message, returns response object or undef.
my $resp = $x->send_tts ( txt => 'This is a test of a machine trying to talk English', phone => '13475524523', gender => 'male', language => 'en', response => 0, ); print Data::Dumper ($resp);
Check for list of available languages at http://www.smsmatrix.com/?sms-gateway-json
Not implemented yet...
Daniel Rokosz, <daniel at smsmatrix.com>
<daniel at smsmatrix.com>
Please report any bugs or feature requests to bug-sms-matrix at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=SMS-Matrix. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
bug-sms-matrix at rt.cpan.org
You can find documentation for this module with the perldoc command.
perldoc SMS::Matrix
You can also look for information at:
RT: CPAN's request tracker
http://rt.cpan.org/NoAuth/Bugs.html?Dist=SMS-Matrix
AnnoCPAN: Annotated CPAN documentation
http://annocpan.org/dist/SMS-Matrix
CPAN Ratings
http://cpanratings.perl.org/d/SMS-Matrix
Search CPAN
http://search.cpan.org/dist/SMS-Matrix/
SMSMatrix website
http://www.smsmatrix.com
Daniel Rokosz <daniel@smsmatrix.com>
This software is Copyright (c) 2009 by Daniel Rokosz. This is free software, licensed under: The Artistic License 2.0 (GPL Compatible)
To install SMS::Matrix, copy and paste the appropriate command in to your terminal.
cpanm
cpanm SMS::Matrix
CPAN shell
perl -MCPAN -e shell install SMS::Matrix
For more information on module installation, please visit the detailed CPAN module installation guide.