Cosimo Streppone > Net-SMS-ArxMobile-0.01 > Net::SMS::ArxMobile

Download:
Net-SMS-ArxMobile-0.01.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 0.01   Source  

NAME ^

Net::SMS::ArxMobile - Send SMS messages via the ArXMobile HTTP API

VERSION ^

version 0.01

SYNOPSIS ^

  # 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
  }

DESCRIPTION ^

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.

METHODS ^

new( _auth_code = '{ArxMobile auth code}')>

Nothing fancy. You need to supply your Arxmobile auth code in the constructor, or it will complain loudly.

send_sms(to = $phone_number, text => $message)>

Uses the API to send a message given in $message to the phone number given in $phone_number.

NOTE: Your ability to send messages outside of the United States could be limited.

Phone number should be given in one of these formats:

+1 888 555 1234
18885551234

Returns a string that is the smsid.

The smsid can be used to query the status via the query_smsid() method.

This API is explicitly SMS::Send compatible.

query_smsid(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.

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.

SEE ALSO ^

ArXMobile website, http://www.arxmobile.com/

AUTHOR ^

Cosimo Streppone <cosimo@opera.com>

COPYRIGHT AND LICENSE ^

This software is Copyright (c) 2011 by Opera Software ASA.

This is free software, licensed under:

  The (three-clause) BSD License
syntax highlighting: