Perl Sample Code (GET)
#!/usr/bin/perl
use LWP::Simple;
my $apiKey = "apikey=" . 'yourapiKey';
my $message = "&message=" . "This is your message";
my $sender = "&sender=" . "SmartSMS";
my $phone = "&phone=" . "923331234567,923451234567,923001234567";
my $getString = join "", "http://www.hajanaone.com/api/sendsms.php?", $apiKey, $message , $sender , $phone;
my $contents = get($getString);
print "$contents";
Perl Sample Code (POST)
#!/usr/bin/perl
use strict;
use LWP::UserAgent;
use HTTP::Request::Common;
my $apikey = 'yourApikey';
my $sender = "SmartSMS";
my $phone = "923331234567,923451234567,923001234567";
my $message = "This is your message";
my $ua = LWP::UserAgent->new();
my $res = $ua->request
(
POST 'http://www.hajanaone.com/api/sendsms.php?',
Content_Type => 'application/x-www-form-urlencoded',
Content => [
'apikey' => $apikey,
'phone' => $phone,
'message' => $message,
'sender' => $sender
]
);
if ($res->is_error) { die "HTTP Errorn"; }
print "Response:nn" . $res->content . "nn";