/srs/search_contacts


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

Search the domain contacts for a client.

Query Parameters

ParameterTypeRequiredDescription
client_idintegerYesThe ID for the client.Example: 1
query[name]stringThe contact name.Example: Example
query[registrant_name]stringThe registrant name.Example: Example
query[postal_address]stringThe postal address.Example: 1 Example Rd
query[suburb]stringThe suburb.Example: Ellerslie
query[postcode]stringThe postcode.Example: 612
query[province]stringThe province.Example: Ellerslie
query[city]stringThe city.Example: Auckland
query[country]stringThe country.Example: NZ
query[email]stringThe email address.Example: example@example.com
query[phone_local]stringThe local phone number.Example: 6403123456
query[fax_local]stringThe local fax number.Example: 6403123456
query[mobile_local]stringThe local mobile.Example: 64021123456
query[default_contact]integerSet as default contact. 1 for yes and 0 for noExample: 1
offsets[offset]integerThe offset value.
offsets[limit]integerThe number of items per page.

Code Samples

JavaScript PHP Rails Python
var xmlHttp = new XMLHttpRequest();
xmlHttp.open("GET", "https://api.sitehost.nz/1.2/srs/search_contacts.json?apikey=your_key_here&client_id=1&query[name]=Example&query[registrant_name]=Example&query[postal_address]=1+Example+Rd&query[suburb]=Ellerslie&query[postcode]=612&query[province]=Ellerslie&query[city]=Auckland&query[country]=NZ&query[email]=example%40example.com&query[phone_local]=6403123456&query[fax_local]=6403123456&query[mobile_local]=64021123456&query[default_contact]=1", false);

xmlHttp.send();

var response = xmlHttp.responseText;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api.sitehost.nz/1.2/srs/search_contacts.json?apikey=your_key_here&client_id=1&query[name]=Example&query[registrant_name]=Example&query[postal_address]=1+Example+Rd&query[suburb]=Ellerslie&query[postcode]=612&query[province]=Ellerslie&query[city]=Auckland&query[country]=NZ&query[email]=example%40example.com&query[phone_local]=6403123456&query[fax_local]=6403123456&query[mobile_local]=64021123456&query[default_contact]=1");
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/search_contacts.json?apikey=your_key_here&client_id=1&query[name]=Example&query[registrant_name]=Example&query[postal_address]=1+Example+Rd&query[suburb]=Ellerslie&query[postcode]=612&query[province]=Ellerslie&query[city]=Auckland&query[country]=NZ&query[email]=example%40example.com&query[phone_local]=6403123456&query[fax_local]=6403123456&query[mobile_local]=64021123456&query[default_contact]=1")
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/search_contacts.json?apikey=your_key_here&client_id=1&query[name]=Example&query[registrant_name]=Example&query[postal_address]=1+Example+Rd&query[suburb]=Ellerslie&query[postcode]=612&query[province]=Ellerslie&query[city]=Auckland&query[country]=NZ&query[email]=example%40example.com&query[phone_local]=6403123456&query[fax_local]=6403123456&query[mobile_local]=64021123456&query[default_contact]=1'

response = requests.get(uri)

Response

200:

application/json
{
  "return": [
    {
      "client_id": "1",
      "contact_id": "383",
      "name": "Example",
      "email": "example@example.com",
      "phone_cntry": "0064",
      "phone_area": "09",
      "phone_local": "123456",
      "domain_count": "1"
    }
  ],
  "msg": "Successful.",
  "status": true
}