/dns/list_domains_using_template


GET https://api.sitehost.nz/1.2/dns/list_domains_using_template.json

Lists all domains using a specific template.

Query Parameters

ParameterTypeRequiredDescription
client_idintegerYesThe ID for the client that the domains belong to.Example: 1
template_idintegerYesThe template id number.Example: 1

Code Samples

JavaScript PHP Rails Python
var xmlHttp = new XMLHttpRequest();
xmlHttp.open("GET", "https://api.sitehost.nz/1.2/dns/list_domains_using_template.json?apikey=your_key_here&client_id=1&template_id=1", false);

xmlHttp.send();

var response = xmlHttp.responseText;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api.sitehost.nz/1.2/dns/list_domains_using_template.json?apikey=your_key_here&client_id=1&template_id=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/dns/list_domains_using_template.json?apikey=your_key_here&client_id=1&template_id=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/dns/list_domains_using_template.json?apikey=your_key_here&client_id=1&template_id=1'

response = requests.get(uri)

Response

200:

application/json
{
  "return": {
    "example.com": {
      "domain_id": "1103",
      "client_id": "1",
      "domain": "example.com",
      "domain_r": "moc.elpmaxe",
      "date_created": "0000-00-00 00:00:00",
      "template_id": "165",
      "allow_children": "0",
      "cdn_zone": null,
      "pending": "0"
    }
  },
  "msg": "Successful.",
  "status": true
}