Backup API Server

Backup API Server




We announce the availability of backup API server which can be found at backup.smscenter.gr. The use of the backup server is strongly suggested for all applications and systems and it ensures high availability and seamless operation.

The backup server is located in the Google Cloud and has no outside dependencies of any kind. To use it in your implementation follow this sample code:



<?php

        $endpoint = 'https://smscenter.gr/api/sms/send';
        $backupendpoint = 'https://backup.smscenter.gr/api/sms/send';

        $parameters = array(
            'key'     => 'YOUR API KEY',
            'text'    => 'Your message',
            'from'    => 'sender',
            'to'      => '306971000000',
            'type'    => 'json'
          );
  function call_endpoint($endpoint, $backupendpoint, $parameters){
            $c = curl_init();
            curl_setopt($c, CURLOPT_URL, $endpoint);
            curl_setopt($c, CURLOPT_POST, true);
            curl_setopt($c, CURLOPT_POSTFIELDS, $parameters);
            curl_setopt($c, CURLOPT_RETURNTRANSFER, true);
            curl_setopt($c, CURLOPT_SSL_VERIFYPEER, false);
            curl_setopt($c, CURLOPT_CONNECTTIMEOUT_MS, 1000);
            // try to connect for 1000 ms
            $output =  curl_exec($c);

            if ($output === false ){
              // failed to connect, use backup server
              curl_setopt($c, CURLOPT_URL, $backupendpoint);
              $output =  curl_exec($c);
            }

            curl_close($c);
            return $output;
        }
        $json = json_decode(call_endpoint($endpoint, $backupendpoint, $parameters), true);
        echo '<pre>';
        print_r($json);
      
?>


For more information you can contact us.