you can check the example at:
https://secure.avantvision.net/portlet/api/test
Updated.. Download now full bandwidth graphics. search the forum.
And the code is:
config.php
CODE
<?php
$paramsurl = array(
"login" => "orbitapiusername",
"password" => "orbitapipassword"
);
$hwid = "hardwareid5digitcode";
?>
$paramsurl = array(
"login" => "orbitapiusername",
"password" => "orbitapipassword"
);
$hwid = "hardwareid5digitcode";
?>
index.php
CODE
<?php
echo '<h2>Todays bandwidth:</h2>';
include ("today.php");
echo '<h2>Last 7 days:</h2>';
include ("week.php");
echo '<h2>This month:</h2>';
include ("month.php");
?>
echo '<h2>Todays bandwidth:</h2>';
include ("today.php");
echo '<h2>Last 7 days:</h2>';
include ("week.php");
echo '<h2>This month:</h2>';
include ("month.php");
?>
today.php
CODE
<?php
ini_set('soap.wsdl_cache_enabled', false);
$gb_url = 'https://api.theplanet.com/Svc/HardwareBandwidthService.svc?WSDL';
include("config.php");
$hw_bw_svc = new SoapClient($gb_url, $paramsurl);
$bwdaily = $hw_bw_svc->GetBandwidth(new SoapParam($hwid, 'HardwareID'));
$bwtoday = ($bwdaily->ActualUsage);
$bwallowed = ($bwdaily->AllowedUsage);
echo '<p>';
echo 'Allowed Usage by Month: ';
echo (($bwallowed)/1000000000);
echo 'GB';
echo '</p>';
echo '<p>';
echo 'Todays bandwidth: ';
echo ($bwtoday/1000000);
echo 'MB';
echo '</p>';
echo '<p>';
echo '<img src="imagetoday.php">';
echo '</p>';
?>
ini_set('soap.wsdl_cache_enabled', false);
$gb_url = 'https://api.theplanet.com/Svc/HardwareBandwidthService.svc?WSDL';
include("config.php");
$hw_bw_svc = new SoapClient($gb_url, $paramsurl);
$bwdaily = $hw_bw_svc->GetBandwidth(new SoapParam($hwid, 'HardwareID'));
$bwtoday = ($bwdaily->ActualUsage);
$bwallowed = ($bwdaily->AllowedUsage);
echo '<p>';
echo 'Allowed Usage by Month: ';
echo (($bwallowed)/1000000000);
echo 'GB';
echo '</p>';
echo '<p>';
echo 'Todays bandwidth: ';
echo ($bwtoday/1000000);
echo 'MB';
echo '</p>';
echo '<p>';
echo '<img src="imagetoday.php">';
echo '</p>';
?>
week.php
CODE
<?php
ini_set('soap.wsdl_cache_enabled', false);
$gb_url = 'https://api.theplanet.com/Svc/HardwareBandwidthService.svc?WSDL';
include("config.php");
$params= array(
"HardwareID" => "5digitcode", //insert your hardware id here
"StartDate" => date('Y-m-d',strtotime("-7 days")),
"EndDate" => date("Y-m-d")
);
$hw_bw_svc = new SoapClient($gb_url, $paramsurl);
$bwbyrange = $hw_bw_svc->GetBandwidthTotalByRange(new SoapParam($params,"params"));
$bwthismonth = ($bwbyrange->ActualUsage);
$bwallowed = ($bwbyrange->AllowedUsage);
echo '<p>';
echo 'Bandwidth used last 7 days: ';
echo ($bwthismonth/1000000);
echo 'MB';
echo '</p>';
echo '<p>';
echo 'Period: ';
echo date('Y-m-d',strtotime("-7 days"));
echo ' - ';
echo date("Y-m-d");
echo '</p>';
echo '<p>';
echo '<img src="imageweekly.php">';
echo '</p>';
?>
ini_set('soap.wsdl_cache_enabled', false);
$gb_url = 'https://api.theplanet.com/Svc/HardwareBandwidthService.svc?WSDL';
include("config.php");
$params= array(
"HardwareID" => "5digitcode", //insert your hardware id here
"StartDate" => date('Y-m-d',strtotime("-7 days")),
"EndDate" => date("Y-m-d")
);
$hw_bw_svc = new SoapClient($gb_url, $paramsurl);
$bwbyrange = $hw_bw_svc->GetBandwidthTotalByRange(new SoapParam($params,"params"));
$bwthismonth = ($bwbyrange->ActualUsage);
$bwallowed = ($bwbyrange->AllowedUsage);
echo '<p>';
echo 'Bandwidth used last 7 days: ';
echo ($bwthismonth/1000000);
echo 'MB';
echo '</p>';
echo '<p>';
echo 'Period: ';
echo date('Y-m-d',strtotime("-7 days"));
echo ' - ';
echo date("Y-m-d");
echo '</p>';
echo '<p>';
echo '<img src="imageweekly.php">';
echo '</p>';
?>
month.php
CODE
<?php
ini_set('soap.wsdl_cache_enabled', false);
$gb_url = 'https://api.theplanet.com/Svc/HardwareBandwidthService.svc?WSDL';
include("config.php");
$params= array(
"HardwareID" => "xxxxx", //Insert your hardware id here
"StartDate" => date('Y-m-01'),
"EndDate" => date("Y-m-d")
);
$hw_bw_svc = new SoapClient($gb_url, $paramsurl);
$bwbyrange = $hw_bw_svc->GetBandwidthTotalByRange(new SoapParam($params,"params"));
$bwthismonth = ($bwbyrange->ActualUsage);
$bwallowed = ($bwbyrange->AllowedUsage);
echo '<p>';
echo 'Bandwidth this month: ';
echo ($bwthismonth/1000000);
echo 'MB';
echo '</p>';
echo '<p>';
echo 'Period: ';
echo date('Y-m-01');
echo ' - ';
echo date("Y-m-d");
echo '</p>';
echo '<p>';
echo '<img src="imagemonth.php">';
echo '</p>';
?>
ini_set('soap.wsdl_cache_enabled', false);
$gb_url = 'https://api.theplanet.com/Svc/HardwareBandwidthService.svc?WSDL';
include("config.php");
$params= array(
"HardwareID" => "xxxxx", //Insert your hardware id here
"StartDate" => date('Y-m-01'),
"EndDate" => date("Y-m-d")
);
$hw_bw_svc = new SoapClient($gb_url, $paramsurl);
$bwbyrange = $hw_bw_svc->GetBandwidthTotalByRange(new SoapParam($params,"params"));
$bwthismonth = ($bwbyrange->ActualUsage);
$bwallowed = ($bwbyrange->AllowedUsage);
echo '<p>';
echo 'Bandwidth this month: ';
echo ($bwthismonth/1000000);
echo 'MB';
echo '</p>';
echo '<p>';
echo 'Period: ';
echo date('Y-m-01');
echo ' - ';
echo date("Y-m-d");
echo '</p>';
echo '<p>';
echo '<img src="imagemonth.php">';
echo '</p>';
?>
The graphics are generated as binary only attaching headers....
imagetoday.php
CODE
<?php
ini_set('soap.wsdl_cache_enabled', false);
$gb_url = 'https://api.theplanet.com/Svc/HardwareBandwidthService.svc?WSDL';
include("config.php");
$hw_bw_svc = new SoapClient($gb_url, $paramsurl);
$bwdaily = $hw_bw_svc->GetBandwidth(new SoapParam($hwid, 'HardwareID'));
$bwtoday = ($bwdaily->ActualUsage);
$bwallowed = ($bwdaily->AllowedUsage);
$bwimg = ($bwdaily->Image);
header('Content-type: image/png');
echo $bwimg;
?>
ini_set('soap.wsdl_cache_enabled', false);
$gb_url = 'https://api.theplanet.com/Svc/HardwareBandwidthService.svc?WSDL';
include("config.php");
$hw_bw_svc = new SoapClient($gb_url, $paramsurl);
$bwdaily = $hw_bw_svc->GetBandwidth(new SoapParam($hwid, 'HardwareID'));
$bwtoday = ($bwdaily->ActualUsage);
$bwallowed = ($bwdaily->AllowedUsage);
$bwimg = ($bwdaily->Image);
header('Content-type: image/png');
echo $bwimg;
?>
imageweekly.php
CODE
<?php
ini_set('soap.wsdl_cache_enabled', false);
$gb_url = 'https://api.theplanet.com/Svc/HardwareBandwidthService.svc?WSDL';
include("config.php");
$params= array(
"HardwareID" => "xxxxx", //insert your hardware id here
"StartDate" => date('Y-m-d',strtotime("-7 days")),
"EndDate" => date("Y-m-d")
);
$hw_bw_svc = new SoapClient($gb_url, $paramsurl);
$bwbyrange = $hw_bw_svc->GetBandwidthTotalByRange(new SoapParam($params,"params"));
$bwthismonth = ($bwbyrange->ActualUsage);
$bwallowed = ($bwbyrange->AllowedUsage);
$bwimg = ($bwbyrange->Image);
header('Content-type: image/png');
echo $bwimg;
?>
ini_set('soap.wsdl_cache_enabled', false);
$gb_url = 'https://api.theplanet.com/Svc/HardwareBandwidthService.svc?WSDL';
include("config.php");
$params= array(
"HardwareID" => "xxxxx", //insert your hardware id here
"StartDate" => date('Y-m-d',strtotime("-7 days")),
"EndDate" => date("Y-m-d")
);
$hw_bw_svc = new SoapClient($gb_url, $paramsurl);
$bwbyrange = $hw_bw_svc->GetBandwidthTotalByRange(new SoapParam($params,"params"));
$bwthismonth = ($bwbyrange->ActualUsage);
$bwallowed = ($bwbyrange->AllowedUsage);
$bwimg = ($bwbyrange->Image);
header('Content-type: image/png');
echo $bwimg;
?>
imagemonth.php
CODE
<?php
ini_set('soap.wsdl_cache_enabled', false);
$gb_url = 'https://api.theplanet.com/Svc/HardwareBandwidthService.svc?WSDL';
include("config.php");
$params= array(
"HardwareID" => "xxxxx", //Insert your hardware id here
"StartDate" => date('Y-m-01'),
"EndDate" => date("Y-m-d")
);
$hw_bw_svc = new SoapClient($gb_url, $paramsurl);
$bwbyrange = $hw_bw_svc->GetBandwidthTotalByRange(new SoapParam($params,"params"));
$bwthismonth = ($bwbyrange->ActualUsage);
$bwallowed = ($bwbyrange->AllowedUsage);
$bwimg = ($bwbyrange->Image);
header('Content-type: image/png');
echo $bwimg;
?>
ini_set('soap.wsdl_cache_enabled', false);
$gb_url = 'https://api.theplanet.com/Svc/HardwareBandwidthService.svc?WSDL';
include("config.php");
$params= array(
"HardwareID" => "xxxxx", //Insert your hardware id here
"StartDate" => date('Y-m-01'),
"EndDate" => date("Y-m-d")
);
$hw_bw_svc = new SoapClient($gb_url, $paramsurl);
$bwbyrange = $hw_bw_svc->GetBandwidthTotalByRange(new SoapParam($params,"params"));
$bwthismonth = ($bwbyrange->ActualUsage);
$bwallowed = ($bwbyrange->AllowedUsage);
$bwimg = ($bwbyrange->Image);
header('Content-type: image/png');
echo $bwimg;
?>
i put a zip file in english for everyone to use and test and expand
i will work on reboot now.. hope ticket guys don's hate me lol
peace.
