GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
Nexmo::SMS(3) User Contributed Perl Documentation Nexmo::SMS(3)

Nexmo::SMS - Module for the Nexmo SMS API!

version 0.06

This module simplifies sending SMS through the Nexmo API.

    use Nexmo::SMS;

    my $nexmo = Nexmo::SMS->new(
        server   => 'http://rest.nexmo.com/sms/json',
        username => 'testuser1',
        password => 'testpasswd2',
    );
    
    my $sms = $nexmo->sms(
        text     => 'This is a test',
        from     => 'Test02',
        to       => '452312432',
    ) or die $nexmo->errstr;
    
    my $response = $sms->send || die $sms->errstr;
    
    if ( $response->is_success ) {
        print "SMS was sent...\n";
    }

Version 0.06

create a new object

    my $foo = Nexmo::SMS->new(
        server   => 'http://rest.nexmo.com/sms/json',
        username => 'testuser1',
        password => 'testpasswd2',
    );

Those parameters are optional and they are used as defaults for the message objects

Create a new message object or returns "undef".

    my $sms = $nexmo->sms(
        text     => 'This is a test',
        from     => 'Test02',
        to       => '452312432',
    ) or die $nexmo->errstr;

Send a binary message

    my $binary = $nexmo->sms(
        type     => 'binary',
        udh      => '06050415811581',   # hex encoded udh
        body     => '0011223344556677', # hex encoded body
        from     => 'Test02',
        to       => '452312432',
    ) or die $nexmo->errstr;

return the "last" error as string.

    print $nexmo->errstr;

  my $balance = $nexmo->get_balance;

Not implemented yet...

These attributes are available for "Nexmo::SMS::TextMessage" objects. For each attribute there is a getter/setter:

  $nexmo->server( 'servername' );
  my $server = $nexmo->server;
  • password
  • server
  • username

Renee Baecker, "<module at renee-baecker.de>"

Please report any bugs or feature requests to "bug-nexmo-sms at rt.cpan.org", or through the web interface at <http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Nexmo-SMS>. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

You can find documentation for this module with the perldoc command.

    perldoc Nexmo::SMS

You can also look for information at:

  • RT: CPAN's request tracker

    <http://rt.cpan.org/NoAuth/Bugs.html?Dist=Nexmo-SMS>

  • AnnoCPAN: Annotated CPAN documentation

    <http://annocpan.org/dist/Nexmo-SMS>

  • CPAN Ratings

    <http://cpanratings.perl.org/d/Nexmo-SMS>

  • Search CPAN

    <http://search.cpan.org/dist/Nexmo-SMS/>

Jui-Nan Lin added support for Unicode messages, thanks! (see https://github.com/reneeb/perl-Nexmo-SMS/pull/1/files)

Copyright 2011 Renee Baecker.

This program is released under the following license: artistic_2

Renee Baecker <module@renee-baecker.de>

This software is Copyright (c) 2011 by Renee Baecker.

This is free software, licensed under:

  The Artistic License 2.0 (GPL Compatible)
2011-12-26 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.