NAME

VoIPms - API wrapper for VoIP.ms

SYNOPSIS

use VoIPms;

my $voipms = VoIPms->new( 
  'api_username' => $api_username,
  'api_password' => $api_password,
  // You can optionally defined your own WWW::Mechanize object
);

# Response can be fetched with a hash, or individual key/value pairs
$res = $voipms->response( %url_attrs );
$res = $voipms->response( 'method' => 'methodName', 'key2' => 'value2' );

eg.
$res = $voipms->response( 'method' => 'getSMS', 'did' => '1234567890' );

# All responses will be returned as a hash reference, including a 'status'
# which will have the value 'success' if the call worked.
if ($res->{status} ne 'success') {
  die $res->{status};
}

DESCRIPTION

This module provides all of the documented methods from the VoIP.ms API, as listed here: https://www.voip.ms/m/apidocs.php

Responses from VoIP.ms are provided as JSON but are decoded and returned as pure Perl.

EXPORT

None.

HISTORY

0.01

Initial release supporting all VoIP.ms public API methods. 2019-06-16

SEE ALSO

Official Documentation

The official VoIP.ms API documentation, again, with more thourough explanations of all methods:

https://www.voip.ms/m/apidocs.php

VoIPms::Errors

All responses will have a "status" method which should be 'success' if the call worked. The additional module VoIPms::Errors.pm is available to provide the long description of the short error code returned.

Examples

Some discussion of the author's use of the module here:

https://john.me.tz/projects/article.php?topic=VoIPms

AUTHOR

John Mertz <perl@john.me.tz>

COPYRIGHT AND LICENSE

Copyright (C) 2019 by John Mertz

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.24.1 or, at your option, any later version of Perl 5 you may have available.