/srs/search_contacts
GET https://api.sitehost.nz/1.0/srs/search_contacts.json
Search the domain contacts for a client.
Query Parameters
Parameter | Type | Required | Description |
client_id | integer | Yes | The ID for the client.Example: 1 |
query[name] | string | The contact name.Example: Example | |
query[registrant_name] | string | The registrant name.Example: Example | |
query[postal_address] | string | The postal address.Example: 1 Example Rd | |
query[suburb] | string | The suburb.Example: Ellerslie | |
query[postcode] | string | The postcode.Example: 612 | |
query[province] | string | The province.Example: Ellerslie | |
query[city] | string | The city.Example: Auckland | |
query[country] | string | The country.Example: NZ | |
query[email] | string | The email address.Example: example@example.com | |
query[phone_local] | string | The local phone number.Example: 6403123456 | |
query[fax_local] | string | The local fax number.Example: 6403123456 | |
query[mobile_local] | string | The local mobile.Example: 64021123456 | |
query[default_contact] | integer | Set as default contact. 1 for yes and 0 for noExample: 1 | |
offsets[offset] | integer | The offset value. | |
offsets[limit] | integer | The number of items per page. |
Code Samples
JavaScript PHP Rails Pythonvar xmlHttp = new XMLHttpRequest();
xmlHttp.open("GET", "https://api.sitehost.nz/1.0/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.0/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.0/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.0/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,
"time": 9.71
}
"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,
"time": 9.71
}