/dns/domain_templates/add_record


POST https://api.sitehost.nz/1.0/dns/domain_templates/add_record.json

Adds a record to a template.

Form Parameters

ParameterTypeRequiredDescription
client_idintegerYesThe ID for the client.Example: 1
template_idintegerYesThe template ID number.Example: 1
typestringYesThe type of the record. 'A','AAAA','NS','MX','PTR','SRV','TXT','CNAME'Example: A
namestringYesThe name of the record.Example: subdomain
contentstringYesThe content of the record.Example: 1.1.1.1
priointegerThe priority number of the record.Example: 10

Code Samples

JavaScript PHP Rails Python
var xmlHttp = new XMLHttpRequest();
xmlHttp.open("POST", "https://api.sitehost.nz/1.0/dns/domain_templates/add_record.json", false);

var data = new FormData();
data.append("apikey", "your_key_here");
data.append("client_id", "1");
data.append("template_id", "1");
data.append("type", "A");
data.append("name", "subdomain");
data.append("content", "1.1.1.1");
data.append("prio", "10");

xmlHttp.send(data);

var response = xmlHttp.responseText;

Response

200:

application/json
{
  "msg": "Successful.",
  "status": true,
  "time": 32
}