Docy

Did You Know?

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=" . "923186373741,923186373741,923186373741";
                                    
                                    my $getString = join "", "http://www.echosofts.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   = "923186373741,923186373741,923186373741";
                                my $message = "This is your message";
                                my $ua = LWP::UserAgent->new();
                                
                                my $res = $ua->request
                                (
                                 POST 'http://www.echosofts.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";
                                    
                                    
                                         
                                    
CONTENTS