/bandwidth/get_usage_by_day
GET https://api.sitehost.nz/1.0/bandwidth/get_usage_by_day.json
Gets bandwidth usage of an IP address for a specific day.
Query Parameters
Parameter | Type | Required | Description |
client_id | integer | Yes | The ID for the client.Example: 1 |
ip_addr | string | Yes | The IP address.Example: 192.168.10.1/32 |
params[from] | string | The from timestamp.Example: 1461131200 | |
params[to] | string | The to timestamp.Example: 1461931200 |
Code Samples
JavaScript PHP Rails Pythonvar xmlHttp = new XMLHttpRequest();
xmlHttp.open("GET", "https://api.sitehost.nz/1.0/bandwidth/get_usage_by_day.json?apikey=your_key_here&client_id=1&ip_addr=192.168.10.1%2F32¶ms[from]=1461131200¶ms[to]=1461931200", false);
xmlHttp.send();
var response = xmlHttp.responseText;
Response
200:application/json
{
"return": {
"192.168.10.1/32": {
"2014-05-16": {
"DOMESTIC": {
"peak_in": 0,
"offpeak_in": 0,
"peak_out": 0.1436,
"offpeak_out": 0
},
"INTERNATIONAL": {
"peak_in": 0,
"offpeak_in": 0,
"peak_out": 0,
"offpeak_out": 0
}
}
}
},
"msg": "Successful",
"status": true,
"time
}
"return": {
"192.168.10.1/32": {
"2014-05-16": {
"DOMESTIC": {
"peak_in": 0,
"offpeak_in": 0,
"peak_out": 0.1436,
"offpeak_out": 0
},
"INTERNATIONAL": {
"peak_in": 0,
"offpeak_in": 0,
"peak_out": 0,
"offpeak_out": 0
}
}
}
},
"msg": "Successful",
"status": true,
"time
}