Net::SMS::ArxMobile - Send SMS messages via the ArXMobile HTTP API
version 0.01
# Create a testing sender my $arx = Net::SMS::ArxMobile->new( _auth_code => '{ArXMobile auth code}', ); # Send a message my $sent = $arx->send_sms( text => "You're in a maze of twisty little passages, all alike.", to => '+1 888 555 1212', ); if ($sent) { # Message sent } else { # Something failed }
Perl module to send SMS messages through the HTTP API provided by ArxMobile (www.arxmobile.com).
NOTE: Your ability to send messages outside of the United States could be limited.
Example of formats that work are:
+1 888 555 1234
18885551234
I have never tried this code with non-US numbers. Probably it works. Probably depends on your auth code?
Probably the Earth will be hit by a massive asteroid in 5 seconds.
new( _auth_code =
Nothing fancy. You need to supply your Arxmobile auth code in the constructor, or it will complain loudly.
send_sms(to =
Uses the API to send a message given in $message to the phone number given in $phone_number.
$message
$phone_number
Phone number should be given in one of these formats:
Returns a string that is the smsid.
The smsid can be used to query the status via the query_smsid() method.
query_smsid()
This API is explicitly SMS::Send compatible.
SMS::Send
query_smsid(smsid =
Queries the ArxMobile server to check the status of an SMS given its smsid. The smsid is obtained through a successful send_sms() call.
send_sms()
Example of HTTP response:
<?xml version='1.0' ?> <results> <result> <phone>{11-digit phone number}</phone> <status>1</status> <error></error> <smsid>{smsid-string}</smsid> <!-- ex.: a552e6f04acd292df310c21b13ea63c8 --> </result> </results>
The method will return a hashref with the correspondent data structure obtained by parsing back the XML file. Example:
{ phone => '{11-digit phone number}', status => '1', error => '', smsid => '{smsid-string}', }
This parsing does not account for multiple results.
Cosimo Streppone <cosimo@opera.com>
This software is Copyright (c) 2011 by Opera Software ASA.
This is free software, licensed under:
The (three-clause) BSD License
To install Net::SMS::ArxMobile, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Net::SMS::ArxMobile
CPAN shell
perl -MCPAN -e shell install Net::SMS::ArxMobile
For more information on module installation, please visit the detailed CPAN module installation guide.