Класс для работы с API на Perl

Класс для работы с API на Perl

Установка

cpanm SmsAero

Использование

use strict;
use warnings;
use SmsAero;

my $SMSAERO_EMAIL = 'your email';
my $SMSAERO_API_KEY = 'your api key';

my $sms = SmsAero->new(
    email => $SMSAERO_EMAIL,
    api_key => $SMSAERO_API_KEY
);

eval {
    my $response = $sms->send_sms(
        number => '70000000000',
        text => 'Hello, World!'
    );
    use Data::Dumper;
    print "API Response:\n", Dumper($response);
};
if ($@) {
    print "An error occurred: $@\n";
}

Доступные методы и параметры вызова смотрите в исходном коде.