/srs/list_contacts


GET https://api.sitehost.nz/1.3/srs/list_contacts.json

Returns a list of all domain contacts.

Query Parameters

ParameterTypeRequiredDescription
client_idintegerYesThe ID for the client.Example: 1
filters[name]stringThe name to filter by.Example: John
filters[email]stringThe email to filter by.Example: mail@example.com
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.3/srs/list_contacts.json?apikey=your_key_here&client_id=1&filters[name]=John&filters[email]=mail%40example.com", false);

xmlHttp.send();

var response = xmlHttp.responseText;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api.sitehost.nz/1.3/srs/list_contacts.json?apikey=your_key_here&client_id=1&filters[name]=John&filters[email]=mail%40example.com");
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/srs/list_contacts.json?apikey=your_key_here&client_id=1&filters[name]=John&filters[email]=mail%40example.com")
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/srs/list_contacts.json?apikey=your_key_here&client_id=1&filters[name]=John&filters[email]=mail%40example.com'

response = requests.get(uri)

Response

200:

application/json
{
  "return": [
    {
      "contact_id": "331",
      "name": "A Domain Contact",
      "registrant_name": "A Domain Contact",
      "email": "domain@sitehost.co.nz",
      "phone_cntry": "64",
      "phone_area": "974",
      "phone_local": "2182",
      "domain_count": "1"
    },
    {
      "contact_id": "383",
      "name": "Example",
      "registrant_name": "Example",
      "email": "example@example.com",
      "phone_cntry": "0064",
      "phone_area": "09",
      "phone_local": "123456",
      "domain_count": "1"
    }
  ],
  "msg": "Successful.",
  "status": true
}