Retrieve Server List in real time for your website

Back

SeFlow allow to retrieve the detailed dedicated server list to keep your website up to date.

First of all you need User and API keys. Open a trouble ticket incuding the IP of your webserver (IPused to retrieve the API information and we will give to you for free.

Now that you have an API you can use our User API 

Here an example to call the server dedicated list

 

$url = 'https://manage.seflow.it/admin/api.php';
$post = array(
'api_id' => "ourapiID",
'api_key' => "yourAPIkey",
'call' => 'getProducts',
'id'=>"3");

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 30);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);

$data = curl_exec($ch);
curl_close($ch);<
$return = json_decode($data, true);

 

Please remember to change ourapiID andyourAPIkey with the keys we gave you.

 

Typical Response

 

{
      "success": true,
      "products": {
         "236": {
            "id": "236",
            "type": "9",
            "name": "VPS-1024-w-sliders",
            "stock": "0",
            "paytype": "Free",
            "description": "",
            "m_setup": "0.00",
            "q_setup": "0.00",
            "s_setup": "0.00",
            "a_setup": "0.00",
            "b_setup": "0.00",
            "t_setup": "0.00",
            "d_setup": "0.00",
            "w_setup": "0.00",
            "h_setup": "0.00",
            "m": "30.00",
            "q": "0.00",
            "a": "0.00",
            "s": "0.00",
            "b": "0.00",
            "t": "0.00",
            "d": "0.00",
            "w": "0.00",
            "h": "0.00",
            "qty": "0",
            "visible": "1",
            "ptype": "onappcloud",
            "accounts": "1"
         },
         "235": {
            "id": "235",
            "type": "9",
            "name": "VPS-512-w-sliders",
            "stock": "0",
            "paytype": "Regular",
            "description": "",
            "m_setup": "0.00",
            "q_setup": "0.00",
            "s_setup": "0.00",
            "a_setup": "0.00",
            "b_setup": "0.00",
            "t_setup": "0.00",
            "d_setup": "0.00",
            "w_setup": "0.00",
            "h_setup": "0.00",
            "m": "20.00",
            "q": "0.00",
            "a": "0.00",
            "s": "0.00",
            "b": "0.00",
            "t": "0.00",
            "d": "0.00",
            "w": "0.00",
            "h": "0.00",
            "qty": "0",
            "visible": "1",
            "ptype": "onappcloud",
            "accounts": "3"
         }
      },
      "call": "getProducts",
      "server_time": 1317712858
   }

If you want have same format has SeFlow Webiste with quantity listing:

 

foreach ($return as $v1) { foreach ($v1 as $v2) {$checkgamma = strpos($v2[name], 'Intel');

if ($v2[visible] == "1" && $checkgamma !== false)

             {

             $v2[m]=round($v2[m], 0);

             $serverqty = ($v2[stock] - $v2[qty]);

            if (($v2[qty] > "-1" && $v2[stock] > "0") || ($v2[qty] == "0" && $v2[stock] == "0"))

                {

                $hwcomponent = explode(" ", $v2[description]);echo "";}  

               }

             }

}

 

CPUMemoryDefault Drive(s)BandwidthQ.tyMonthly ( € ) 
$v2[name]$hwcomponent[1]$hwcomponent[3] $hwcomponent[4]$hwcomponent[6]$v2[qty]$v2[m].00 + ivaCustomize
 

$serverqty is integer of avaiable servers. If > 0 server is in stock.

Now you can get the product details. Please refer to GetProductDetails function

Was this article helpful?
Dislike0 Like0

Views: 1407