Serverstadium Customer Api
Serverstadium Customer Api
Get Bandwidth
Reboot
Get Bandwidth
POST https://api.serverstadium.com
This API will return the bandwidth data for specified server.
BODY
(*) is required
api_key* 5D7378CEC3B5ED4EA6C9B59D9CC972A3
Access key that you get after registering your IP address
cust_id* 4550
Your customer ID (you can get this from our customer portal)
cust_email* [email protected]
Your primary email that you use to access our customer portal
cust_ip* 216.239.51.99
IP address that you registered
prod_id* 20026
Your product ID (you can get this from our customer portal)
action* bandwidth
Please specified 'bandwidth' to get the bandwidth data
Example Request
Below example is written in PHP language.
$postfields = array(
'api_key' => '5D7378CEC3B5ED4EA6C9B59D9CC972A3',
'cust_email' => '[email protected]',
'cust_id' => 1234,
'cust_ip' => '216.239.51.99',
'prod_id' => 5678,
'action' => 'bandwidth'
);
$ch = curl_init();
curl_setop($ch, CURLOPT_URL, 'https://api.serverstadium.com');
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 100);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postfields);
$json_data = curl_exec($ch);
if (curl_error($ch)) {
die("Connection error: " . curl_errno($ch) . ' - ' . curl_error($ch));
}
curl_close($ch);
$result = json_decode($json_data);
Example Response
200 OK
[
{
"graphDataMonthly": {
"traffic_in": {
"1540958400": 98.351045747291,
"1540965600": 98.708891388917,
"1540972800": 98.189521840366,
"1541023200": 98.399867072721,
"1541030400": 103.54751944444,
"1541037600": 99.310875
},
"traffic_out": {
"1540958400": 98.351045747291,
"1540965600": 98.708891388917,
"1540972800": 98.189521840366,
"1541023200": 98.399867072721,
"1541030400": 103.54751944444,
"1541037600": 99.310875
},
"ninetyfifth": 2870.0009808993,
"totalbytes": 151262.79124522
},
{
"graphDataWeekly": {
"traffic_in": {
"1540958400": 98.351045747291,
"1540965600": 98.708891388917,
"1540972800": 98.189521840366,
"1541023200": 98.399867072721,
"1541030400": 103.54751944444,
"1541037600": 99.310875
},
"traffic_out": {
"1540958400": 98.351045747291,
"1540965600": 98.708891388917,
"1540972800": 98.189521840366,
"1541023200": 98.399867072721,
"1541030400": 103.54751944444,
"1541037600": 99.310875
},
"ninetyfifth": 2870.0009808993,
"totalbytes": 151262.79124522
},
"graphDataDaily": {
"traffic_in": {
"1540958400": 98.351045747291,
"1540965600": 98.708891388917,
"1540972800": 98.189521840366,
"1541023200": 98.399867072721,
"1541030400": 103.54751944444,
"1541037600": 99.310875
},
"traffic_out": {
"1540958400": 98.351045747291,
"1540965600": 98.708891388917,
"1540972800": 98.189521840366,
"1541023200": 98.399867072721,
"1541030400": 103.54751944444,
"1541037600": 99.310875
},
"ninetyfifth": 2870.0009808993,
"totalbytes": 151262.79124522
},
}
Reboot
POST https://api.serverstadium.com
BODY
(*) is required
api_key* 5D7378CEC3B5ED4EA6C9B59D9CC972A3
Access key that you get after registering your IP address
cust_id* 4550
Your customer ID (you can get this from our customer portal)
cust_email* [email protected]
Your primary email that you use to access our customer portal
cust_ip* 216.239.51.99
IP address that you registered
prod_id* 20026
Your product ID (you can get this from our customer portal)
action* bandwidth
Please specified 'bandwidth' to get the bandwidth data
Example Request
Below example is written in PHP language.
$postfields = array(
'api_key' => '5D7378CEC3B5ED4EA6C9B59D9CC972A3',
'cust_email' => '[email protected]',
'cust_id' => 1234,
'cust_ip' => '216.239.51.99',
'prod_id' => 5678,
'action' => 'bandwidth'
);
$ch = curl_init();
curl_setop($ch, CURLOPT_URL, 'https://api.serverstadium.com');
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 100);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postfields);
$json_data = curl_exec($ch);
if (curl_error($ch)) {
die("Connection error: " . curl_errno($ch) . ' - ' . curl_error($ch));
}
curl_close($ch);
$result = json_decode($json_data);
Example Response
200 OK
{
"result": true,
"product_id": "20026",
"power_action_id": "124",
"message": "Reboot request added to the queue"
}
Instant Dedicated Servers
Use this APIs to communicate with our insant dedicated servers.
Available actions :
Power Action
Available OS
Reinstall OS
Get Stock
Get Bandwidth (use the 'bandwidth' action as explained in 'Custom Dedicated Servers' section)
Power Action
POST https://api.serverstadium.com
This API will insert a new job to turn on, turn off, or reset specified server to the queue.
BODY
(*) is required
api_key* 5D7378CEC3B5ED4EA6C9B59D9CC972A3
Access key that you get after registering your IP address
cust_id* 4550
Your customer ID (you can get this from our customer portal)
cust_email* [email protected]
Your primary email that you use to access our customer portal
cust_ip* 216.239.51.99
IP address that you registered
prod_id* 20026
Your product ID (you can get this from our customer portal)
action* poweraction
Please specified with 'poweraction' to perform available action to the server
power_action* on|off|reset
Please specified 'on' if you want to turn on the server, or 'off' if you want to turn off the
server, or 'reset' if you want to reset the server
Example Request
Below example is written in PHP language.
$postfields = array(
'api_key' => '5D7378CEC3B5ED4EA6C9B59D9CC972A3',
'cust_email' => '[email protected]',
'cust_id' => 1234,
'cust_ip' => '216.239.51.99',
'prod_id' => 5678,
'action' => 'poweraction',
'power_action' => 'on'
);
$ch = curl_init();
curl_setop($ch, CURLOPT_URL, 'https://api.serverstadium.com');
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 100);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postfields);
$json_data = curl_exec($ch);
if (curl_error($ch)) {
die("Connection error: " . curl_errno($ch) . ' - ' . curl_error($ch));
}
curl_close($ch);
$result = json_decode($json_data);
Example Response
200 OK
true
Available OS
POST https://api.serverstadium.com
BODY
(*) is required
api_key* 5D7378CEC3B5ED4EA6C9B59D9CC972A3
Access key that you get after registering your IP address
cust_id* 4550
Your customer ID (you can get this from our customer portal)
cust_email* [email protected]
Your primary email that you use to access our customer portal
cust_ip* 216.239.51.99
IP address that you registered
prod_id* 20026
Your product ID (you can get this from our customer portal)
action* availableos
Please specified with 'availableos' to get available OS to be reinstalled to the specified server.
Example Request
Below example is written in PHP language.
$postfields = array(
'api_key' => '5D7378CEC3B5ED4EA6C9B59D9CC972A3',
'cust_email' => '[email protected]',
'cust_id' => 1234,
'cust_ip' => '216.239.51.99',
'prod_id' => 5678,
'action' => 'availableos',
);
$ch = curl_init();
curl_setop($ch, CURLOPT_URL, 'https://api.serverstadium.com');
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 100);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postfields);
$json_data = curl_exec($ch);
if (curl_error($ch)) {
die("Connection error: " . curl_errno($ch) . ' - ' . curl_error($ch));
}
curl_close($ch);
$result = json_decode($json_data);
Example Response
200 OK
[
{
"product_option_id": "2104",
"display_name": "CentOS 5.11 (32-bit)"
},
{
"product_option_id": "2090",
"display_name": "CentOS 6 (latest)"
},
]
Reinstall OS
POST https://api.serverstadium.com
BODY
(*) is required
api_key* 5D7378CEC3B5ED4EA6C9B59D9CC972A3
Access key that you get after registering your IP address
cust_id* 4550
Your customer ID (you can get this from our customer portal)
cust_email* [email protected]
Your primary email that you use to access our customer portal
cust_ip* 216.239.51.99
IP address that you registered
prod_id* 20026
Your product ID (you can get this from our customer portal)
action* reinstallos
Please specified with 'reinstallos' to reinstall OS to the server.
profile_id* 2345
Choosen OS to be reinstalled to the server (you can get this from 'availableos' function, and pass
the 'product_option_id' to the argument)
Example Request
Below example is written in PHP language.
$postfields = array(
'api_key' => '5D7378CEC3B5ED4EA6C9B59D9CC972A3',
'cust_email' => '[email protected]',
'cust_id' => 1234,
'cust_ip' => '216.239.51.99',
'prod_id' => 5678,
'action' => 'reinstallos',
'profile_id' => 2345
);
$ch = curl_init();
curl_setop($ch, CURLOPT_URL, 'https://api.serverstadium.com');
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 100);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postfields);
$json_data = curl_exec($ch);
if (curl_error($ch)) {
die("Connection error: " . curl_errno($ch) . ' - ' . curl_error($ch));
}
curl_close($ch);
$result = json_decode($json_data);
Example Response
200 OK
true
Get Stock
POST https://api.serverstadium.com
This API will return list of our instant dedicated servers and the available stock of each server.
BODY
(*) is required
api_key* 5D7378CEC3B5ED4EA6C9B59D9CC972A3
Access key that you get after registering your IP address
cust_id* 4550
Your customer ID (you can get this from our customer portal)
cust_email* [email protected]
Your primary email that you use to access our customer portal
cust_ip* 216.239.51.99
IP address that you registered
action* getstock
Please specified with 'getstock' to get the list of our servers.
package_id 12
(optional) Package ID, use this param to get stock info from 1 package
Example Request
Below example is written in PHP language.
$postfields = array(
'api_key' => '5D7378CEC3B5ED4EA6C9B59D9CC972A3',
'cust_email' => '[email protected]',
'cust_id' => 1234,
'cust_ip' => '216.239.51.99',
'action' => 'getstock',
);
$ch = curl_init();
curl_setop($ch, CURLOPT_URL, 'https://api.serverstadium.com');
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 100);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postfields);
$json_data = curl_exec($ch);
if (curl_error($ch)) {
die("Connection error: " . curl_errno($ch) . ' - ' . curl_error($ch));
}
curl_close($ch);
$result = json_decode($json_data);
Example Response
200 OK
[
{
"package_name": "Dual L5420 - 16GB DDR2 - 1x500GB SATA",
"processor": "Dual L5420",
"ram": "16 Gig DDR2",
"storage": [
"2x 500 GB SATA 7200RPM"
],
"ip_address": "4 usable IPs",
"bandwidth": "10 TB - 1 Gbps port",
"available_stock": "2"
},
{
"package_name": "Dual L5520 - 16GB DDR2 - 1x500GB SATA",
"processor": "Dual L5520",
"ram": "16 Gig DDR2",
"storage": [
"1x 500 GB SATA 7200RPM"
],
"ip_address": "4 usable IPs",
"bandwidth": "10 TB - 1 Gbps port",
"available_stock": "2"
},
]