API-Intis
view release on metacpan or search on metacpan
API/Intis/Makefile.PL view on Meta::CPAN
NAME => 'API::Intis',
VERSION_FROM => 'lib/API/Intis.pm', # finds \$VERSION
AUTHOR => 'Nick Nomos (nnmos@cpan.org)',
ABSTRACT => 'Intis Telecom API',
PREREQ_PM => {
'Test::Simple' => '0',
'Modern::Perl' => '0',
'YAML::Tiny' => '0',
'WWW::Mechanize' => '0',
'Crypt::SSLeay' => '0',
'JSON' => '0',
'Digest::Perl::MD5' => '0',
'Switch' => '0',
},
);
API/Intis/README.mkdn view on Meta::CPAN
version 1.00
# SYNOPSIS
use API::Intis;
my $ballance = API::Intis::APIRequest->new('balance', [\%addition_params]);
## Description
The Intis telecom gateway lets you send SMS messages worldwide via its API. This program sends HTTP(s) requests and receives information as a response in JSON and/or XML. The main functions of our API include:
* sending SMS messages (including scheduling options);
* receiving status reports about messages that have been sent previously;
* requesting lists of authorised sender names;
* requesting lists of incoming SMS messages;
* requesting current balance status;
* requesting lists of databases;
* requesting lists of numbers within particular contact list;
* searching for a particular number in a stop list;
* adding new templates;
API/Intis/README.mkdn view on Meta::CPAN
3. Call API with method with additional options
```perl
my $ballance = APIRequest->new('balance', \%addition_params);
```
*Note: list if additional options. [Look list of methods](#aviable-methods).*
The names of the method are the name .php file
The response object contains the following attributes:
* Request is in the form of JSON
```perl
$ballance->{request_json};
```
* Request is in the form of XML
```perl
$ballance->{request_xml};
```
* Requested text description of the error
```perl
$ballance->{error};
API/Intis/lib/API/Intis.pm view on Meta::CPAN
@EXPORT = qw();
@EXPORT_OK = qw();
%EXPORT_TAGS = ();
}
package API::Intis::APIGrab;
use YAML::Tiny;
use WWW::Mechanize;
use Crypt::SSLeay;
use Digest::Perl::MD5 'md5_hex';
use JSON;
use error_codes;
sub readConfig {
my $conf = YAML::Tiny->read( 'config.yaml' );
return (login => $conf->[0]->{APIconnector}->{login}, APIkey => $conf->[0]->{APIconnector}->{APIkey}, host => $conf->[0]->{APIconnector}->{host});
};
sub build_signature {
my (%params) = @_;
API/Intis/lib/API/Intis.pm view on Meta::CPAN
my @error;
if ($r->{error}) {
@error = &error_codes::get_name_from_code($r->{error});
} else {
@error = &error_codes::get_name_from_code();
};
return (request_json => $request_json, error => \@error, request_xml => $request_xml, request_object => \%{$r}, out_format => !defined $output_format ? 'json' : $output_format );
};
package API::Intis::APIRequest;
use JSON;
sub new {
my($class, $method, $other_params) = @_;
my %request_params;
if (defined $other_params) {
%request_params = &API::Intis::APIGrab::connect($method, $other_params);
} else {
%request_params = &API::Intis::APIGrab::connect($method, '');
};
my $self = {
name => 'API::Intis::APIRequest',
( run in 0.782 second using v1.01-cache-2.11-cpan-140bd7fdf52 )