/server/list_ips


GET https://api.sitehost.nz/1.0/server/list_ips.json

Lists IP addresses assigned to a client.

Query Parameters

ParameterTypeRequiredDescription
client_idintegerYesThe ID for the client.Example: 1
locationstringYesThe code for a location.Example: AIR
filters[family]stringShow only IP addresses from a specific family. 4 or 6Example: 4
filters[network][]stringShow only IP addresses in a specific network. This parameter accepts one or more values in the format of filters[network][]=x, filters[network][]=y.Example: 192.168.11.91
filters[sort_by]stringThe field name to sort the results by.
filters[sort_dir]stringThe direction to sort in. Valid options are ASC and DESC
filters[page_size]integerThe number of items to return per page.
filters[page_number]integerThe page number to return.

Code Samples

JavaScript PHP Rails Python
var xmlHttp = new XMLHttpRequest();
xmlHttp.open("GET", "https://api.sitehost.nz/1.0/server/list_ips.json?apikey=your_key_here&client_id=1&location=AIR&filters[family]=4&filters[network][]=192.168.11.91", false);

xmlHttp.send();

var response = xmlHttp.responseText;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api.sitehost.nz/1.0/server/list_ips.json?apikey=your_key_here&client_id=1&location=AIR&filters[family]=4&filters[network][]=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.0/server/list_ips.json?apikey=your_key_here&client_id=1&location=AIR&filters[family]=4&filters[network][]=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.0/server/list_ips.json?apikey=your_key_here&client_id=1&location=AIR&filters[family]=4&filters[network][]=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,
  "time": 36.7
}