NAME
SMS::Matrix - Module for the SMSMatrix API!
VERSION
version 1.00
SYNOPSIS
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
Version 1.00
METHODS
new
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_sms
Send new sms message, returns response object or 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);
is_success
returns 1 if message was sent OK
print $x->is_success();
is_error
returns 1 if message was NOT sent OK
print $x->is_error();
status
gets/set status of the message
print $x->status();
username
gets value of the username property
print $x->username();
password
gets value of the password property
print $x->password();
errstr
returns the "last" error as string.
print $x->errstr();
get_balance
Retrieves your current balance - number of credits available for your account
my $resp = $x->get_balance();
print Data::Dumper ($resp);
send
Internal function, do not use it. Its interface may change in the future.
send_tts
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
send_voice
Not implemented yet...
get_history
Not implemented yet...
get_status
Not implemented yet...
get_pricing
Not implemented yet...
AUTHOR
Daniel Rokosz, <daniel at smsmatrix.com>
BUGS
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.
SUPPORT
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
AnnoCPAN: Annotated CPAN documentation
CPAN Ratings
Search CPAN
SMSMatrix website
COPYRIGHT & LICENSE
Copyright 2009 Daniel Rokosz
This program is released under the following license: artistic_2
AUTHOR
Daniel Rokosz <daniel@smsmatrix.com>
COPYRIGHT AND LICENSE
This software is Copyright (c) 2009 by Daniel Rokosz.
This is free software, licensed under:
The Artistic License 2.0 (GPL Compatible)