/server/list_ips
GET https://api.sitehost.nz/1.3/server/list_ips.json
Lists IP addresses assigned to a client.
Query Parameters
Parameter | Type | Required | Description |
client_id | integer | Yes | The ID for the client.Example: 1 |
location | string | Yes | The code for a location.Example: AIR |
filters[family] | string | Show only IP addresses from a specific family. 4 or 6Example: 4 | |
filters[network][0] | string | Show only IP addresses in a specific network. This parameter accepts one or more values in the format of filters[network][0]=x, filters[network][1]=y.Example: 192.168.11.91 | |
filters[sort_by] | string | The field name to sort the results by. | |
filters[sort_dir] | string | The direction to sort in. Valid options are ASC and DESC | |
filters[page_size] | integer | The number of items to return per page. | |
filters[page_number] | integer | The page number to return. |
Code Samples
JavaScript PHP Rails Pythonvar xmlHttp = new XMLHttpRequest();
xmlHttp.open("GET", "https://api.sitehost.nz/1.3/server/list_ips.json?apikey=your_key_here&client_id=1&location=AIR&filters[family]=4&filters[network][0]=192.168.11.91", false);
xmlHttp.send();
var response = xmlHttp.responseText;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api.sitehost.nz/1.3/server/list_ips.json?apikey=your_key_here&client_id=1&location=AIR&filters[family]=4&filters[network][0]=192.168.11.91");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$response = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
require 'net/http'
require 'uri'
uri = URI.parse("https://api.sitehost.nz/1.3/server/list_ips.json?apikey=your_key_here&client_id=1&location=AIR&filters[family]=4&filters[network][0]=192.168.11.91")
http = Net::HTTP.new(uri.host, uri.port)
request = Net::HTTP::Get.new(uri.request_uri)
response = http.request(request)
import requests
uri = 'https://api.sitehost.nz/1.3/server/list_ips.json?apikey=your_key_here&client_id=1&location=AIR&filters[family]=4&filters[network][0]=192.168.11.91'
response = requests.get(uri)
Response
200:application/json
{
"return": [
{
"ip_addr": "192.168.11.91",
"prefix": 32,
"family": 4
},
{
"ip_addr": "192.168.11.92",
"prefix": 32,
"family": 4
},
{
"ip_addr": "192.168.11.93",
"prefix": 32,
"family": 4
},
{
"ip_addr": "192.168.11.94",
"prefix": 32,
"family": 4
},
{
"ip_addr": "192.168.11.164",
"prefix": 32,
"family": 4
},
{
"ip_addr": "192.168.11.198",
"prefix": 32,
"family": 4
}
],
"msg": "Successful",
"status": true
}
"return": [
{
"ip_addr": "192.168.11.91",
"prefix": 32,
"family": 4
},
{
"ip_addr": "192.168.11.92",
"prefix": 32,
"family": 4
},
{
"ip_addr": "192.168.11.93",
"prefix": 32,
"family": 4
},
{
"ip_addr": "192.168.11.94",
"prefix": 32,
"family": 4
},
{
"ip_addr": "192.168.11.164",
"prefix": 32,
"family": 4
},
{
"ip_addr": "192.168.11.198",
"prefix": 32,
"family": 4
}
],
"msg": "Successful",
"status": true
}