/srs/create_domain
POST https://api.sitehost.nz/1.3/srs/create_domain.json
Creates a domain.
Form Parameters
Parameter | Type | Required | Description |
client_id | integer | Yes | The ID for the client that the domain belongs to.Example: 1 |
domain | string | Yes | The domain name to be created.Example: example.com |
term | integer | Yes | The domain registration term in months.Example: 12 |
registrant_contact | integer | Yes | The ID of a domain contact to be used as the registrant contact.Example: 12 |
params[RegisterExpired] | integer | The option to register this domain when it becomes available. 1 for yes and 0 for noExample: 0 | |
params[AdminContact] | integer | The ID of a domain contact to be used as the administrative contact.Example: 12 | |
params[TechContact] | integer | The ID of a domain contact to be used as the technical contact.Example: 12 | |
params[BillingContact] | integer | The ID of a domain contact to be used as the billing contact.Example: 12 | |
params[protect] | string | The option for Privacy Protection. 1 for yes and 0 for noExample: 0 | |
params[auid_type] | string | The option for Australian Business Number Type. | |
params[auid_value] | string | The option for Australian Business Number. | |
params[auid_reason] | string | The option for Australian Domain Reason. | |
params[auid_cname] | string | The option for Australian Company Name. | |
params[auid_ctype] | string | The option for Australian Company Type. |
Code Samples
JavaScript PHP Rails Pythonvar xmlHttp = new XMLHttpRequest();
xmlHttp.open("POST", "https://api.sitehost.nz/1.3/srs/create_domain.json", false);
var data = new FormData();
data.append("apikey", "your_key_here");
data.append("client_id", "1");
data.append("domain", "example.com");
data.append("term", "12");
data.append("registrant_contact", "12");
data.append("params[RegisterExpired]", "0");
data.append("params[AdminContact]", "12");
data.append("params[TechContact]", "12");
data.append("params[BillingContact]", "12");
data.append("params[protect]", "0");
data.append("params[auid_type]", "");
data.append("params[auid_value]", "");
data.append("params[auid_reason]", "");
data.append("params[auid_cname]", "");
data.append("params[auid_ctype]", "");
xmlHttp.send(data);
var response = xmlHttp.responseText;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api.sitehost.nz/1.3/srs/create_domain.json");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
$body = array(
'apikey' => 'your_key_here',
'client_id' => 1,
'domain' => 'example.com',
'term' => 12,
'registrant_contact' => 12,
'params[RegisterExpired]' => 0,
'params[AdminContact]' => 12,
'params[TechContact]' => 12,
'params[BillingContact]' => 12,
'params[protect]' => '0',
'params[auid_type]' => '',
'params[auid_value]' => '',
'params[auid_reason]' => '',
'params[auid_cname]' => '',
'params[auid_ctype]' => '',
);
curl_setopt($ch, CURLOPT_POSTFIELDS, $body);
$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.3/srs/create_domain.json")
http = Net::HTTP.new(uri.host, uri.port)
request = Net::HTTP::Post.new(uri.request_uri)
body = {"apikey" => "your_key_here",
"client_id" => 1,
"domain" => "example.com",
"term" => 12,
"registrant_contact" => 12,
"params[RegisterExpired]" => 0,
"params[AdminContact]" => 12,
"params[TechContact]" => 12,
"params[BillingContact]" => 12,
"params[protect]" => "0",
"params[auid_type]" => "",
"params[auid_value]" => "",
"params[auid_reason]" => "",
"params[auid_cname]" => "",
"params[auid_ctype]" => "",
}
request.set_form_data(body)
response = http.request(request)
import requests
from collections import OrderedDict
uri = 'https://api.sitehost.nz/1.3/srs/create_domain.json'
# We need ordered dictionary because parameters have to be in the right order.
# Refer to Developer Notes for more information.
body = OrderedDict()
body['apikey'] = 'your_key_here'
body['client_id'] = 1
body['domain'] = 'example.com'
body['term'] = 12
body['registrant_contact'] = 12
body['params[RegisterExpired]'] = 0
body['params[AdminContact]'] = 12
body['params[TechContact]'] = 12
body['params[BillingContact]'] = 12
body['params[protect]'] = '0'
body['params[auid_type]'] = ''
body['params[auid_value]'] = ''
body['params[auid_reason]'] = ''
body['params[auid_cname]'] = ''
body['params[auid_ctype]'] = ''
response = requests.post(uri, data=body)
Response
200:application/json
{
"return": {
"job_id": "3433562"
},
"msg": "Successful",
"status": true
}
"return": {
"job_id": "3433562"
},
"msg": "Successful",
"status": true
}