Docy

Did You Know?

PHP Sample Code (GET)

                                        
                                            <?php
                                            
                                           $apikey   =    "ZJN*****vB";
                                           $sender   =    "Echosofts";
                                           $mobile   =    "923186373741";
                                           $message  =    "Test SMS From Echosofts";
                                           
                                           //Sending SMS
                                           
                                            $url='https://www.echosofts.com/api/sendsms.php?apikey='.api$key.'&phone='.$mobile.'&sender='.urlencode($sender).'&message='.urlencode($message);
                               
                                                $ch=curl_init();
                                                curl_setopt($ch, CURLOPT_URL,$url);
                                                curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
                                                curl_setopt($ch, CURLOPT_HEADER, 0);
                                                $result = curl_exec ($ch);
                                                echo $result;
                                                
                                            ?>
                                        
                                    

PHP Sample Code (POST)

                                        
                                        
                                            <?php 
                                        
                                           $user_api   =    '******';
                                           $number     =    923186373741;
                                           $sender     =    'Your Mask';
                                           $message    =    'Test message from Echosofts';
                                           
                                           // sending sms
                                           
                                            $base_url = 'http://www.echosofts.com/api/sendsms.php';
                               
                                                $ch=curl_init();
                                                curl_setopt($ch, CURLOPT_URL, $base_url);
                                                curl_setopt($ch, CURLOPT_POST, 1);
                                                curl_setopt($ch, CURLOPT_POSTFIELDS,
                                                
                                            "apikey=".$user_api."&phone=".$nums."&sender=".urlencode($sender)."&message=".urlencode($message));
                                                
                                                curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
                                                $output = curl_exec($ch);
                                                curl_close ($ch);
                                                
                                                if (preg_match( "/successfully/", $output )){
                                                echo 'Message Sent Successfully';
                                                }else{
                                                echo 'Message senging failed';  
                                                    }
                                          ?>
                                        
                                         
                                    
CONTENTS