/srs/list_domains


GET https://api.sitehost.nz/1.2/srs/list_domains.json

Returns a list of registered domains for a client.

Query Parameters

ParameterTypeRequiredDescription
client_idintegerYesThe ID for the client.Example: 1
filters[domain]stringThe domain name search string.Example: example.nz
filters[contact_id]integerThe contact ID.Example: 1
filters[state]stringThe domain state.Example: Available
filters[billed_until]stringThe domain billing date.Example: 2017-03-17 11:59:36
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.2/srs/list_domains.json?apikey=your_key_here&client_id=1&filters[domain]=example.nz&filters[contact_id]=1&filters[state]=Available&filters[billed_until]=2017-03-17+11%3A59%3A36", false);

xmlHttp.send();

var response = xmlHttp.responseText;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api.sitehost.nz/1.2/srs/list_domains.json?apikey=your_key_here&client_id=1&filters[domain]=example.nz&filters[contact_id]=1&filters[state]=Available&filters[billed_until]=2017-03-17+11%3A59%3A36");
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.2/srs/list_domains.json?apikey=your_key_here&client_id=1&filters[domain]=example.nz&filters[contact_id]=1&filters[state]=Available&filters[billed_until]=2017-03-17+11%3A59%3A36")
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.2/srs/list_domains.json?apikey=your_key_here&client_id=1&filters[domain]=example.nz&filters[contact_id]=1&filters[state]=Available&filters[billed_until]=2017-03-17+11%3A59%3A36'

response = requests.get(uri)

Response

200:

application/json
{
  "return": {
    "total_items": 1,
    "current_items": 1,
    "current_page": 1,
    "total_pages": 1,
    "data": [
      {
        "domain_id": "9",
        "client_id": "1",
        "domain": "mydomain.nz",
        "state": "Active",
        "api": "NZRS",
        "locked": "0",
        "private": "0",
        "pending": "0",
        "registrant_name": "My Domain Contact",
        "reg_id": "331",
        "adm_id": "331",
        "tec_id": "331",
        "dateregistered": "2016-03-17 11:59:36",
        "datemodified": "2016-03-17 11:59:38",
        "datebilleduntil": "2017-03-17 11:59:36",
        "datecancelled": "0000-00-00 00:00:00",
        "datelocked": "0000-00-00 00:00:00",
        "autorenew_term": "0",
        "autorenew_days_remaining": "0",
        "reg_name": "My Domain Contact",
        "adm_name": "My Domain Contact",
        "tec_name": "My Domain Contact",
        "client_name": "My SiteHost Account"
      }
    ]
  },
  "msg": "Successful",
  "status": true
}