/dns/list_records
GET https://api.sitehost.nz/1.0/dns/list_records.json
Lists all records for a domain.
Query Parameters
Parameter | Type | Required | Description |
client_id | integer | Yes | The ID for the client that the records belong to.Example: 1 |
domain | string | Yes | The domain name.Example: example.nz |
Code Samples
JavaScript PHP Rails Pythonvar xmlHttp = new XMLHttpRequest();
xmlHttp.open("GET", "https://api.sitehost.nz/1.0/dns/list_records.json?apikey=your_key_here&client_id=1&domain=example.nz", false);
xmlHttp.send();
var response = xmlHttp.responseText;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api.sitehost.nz/1.0/dns/list_records.json?apikey=your_key_here&client_id=1&domain=example.nz");
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/dns/list_records.json?apikey=your_key_here&client_id=1&domain=example.nz")
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/dns/list_records.json?apikey=your_key_here&client_id=1&domain=example.nz'
response = requests.get(uri)
Response
200:application/json
{
"return": [
{
"id": "5432",
"name": "example.nz",
"type": "SOA",
"content": "ns1.sitehost.co.nz soa@sitehost.co.nz 2016041512 10800 3600 604800 3600",
"ttl": "3600",
"prio": "0",
"change_date": "1460691823",
"state": "0"
},
{
"id": "6427",
"name": "example.nz",
"type": "NS",
"content": "ns1.sitehost.co.nz",
"ttl": "3600",
"prio": "0",
"change_date": "1424281844",
"state": "0"
},
{
"id": "6428",
"name": "example.nz",
"type": "NS",
"content": "ns2.sitehost.co.nz",
"ttl": "3600",
"prio": "0",
"change_date": "1424281844",
"state": "0"
}
],
"msg": "Successful.",
"status": true,
"time": 13.27
}
"return": [
{
"id": "5432",
"name": "example.nz",
"type": "SOA",
"content": "ns1.sitehost.co.nz soa@sitehost.co.nz 2016041512 10800 3600 604800 3600",
"ttl": "3600",
"prio": "0",
"change_date": "1460691823",
"state": "0"
},
{
"id": "6427",
"name": "example.nz",
"type": "NS",
"content": "ns1.sitehost.co.nz",
"ttl": "3600",
"prio": "0",
"change_date": "1424281844",
"state": "0"
},
{
"id": "6428",
"name": "example.nz",
"type": "NS",
"content": "ns2.sitehost.co.nz",
"ttl": "3600",
"prio": "0",
"change_date": "1424281844",
"state": "0"
}
],
"msg": "Successful.",
"status": true,
"time": 13.27
}