/srs/update_contact


POST https://api.sitehost.nz/1.3/srs/update_contact.json

Updates a domain contact.

Form Parameters

ParameterTypeRequiredDescription
client_idintegerYesThe ID for the client that the contact belongs to.Example: 1
contact_idintegerYesThe contact ID number.Example: 1
params[Name]stringThe contact name.Example: Example
params[Email]stringThe email address.Example: example@example.com
params[PostalAddress]stringThe postal address.Example: 1 Example Rd
params[PostalAddress2]stringThe postal address 2.Example: Round the bend
params[Suburb]stringThe suburb.Example: Ellerslie
params[City]stringThe city.Example: Auckland
params[Country]stringThe country.Example: NZ
params[PostCode]stringThe postcode.Example: 612
params[Province]stringThe province.Example: Ellerslie
params[Organization]stringThe organization.Example: Example Corp.
params[Phone][Country]stringThe country code for the phone number.Example: 64
params[Phone][Area]stringThe area code for the phone number.Example: 9
params[Phone][Local]stringThe local part of the phone number.Example: 123456
params[Phone][Extension]stringThe extension part of the phone number.Example: 789
params[Fax][Country]stringThe country code for the fax number.Example: 64
params[Fax][Area]stringThe area code for the fax number.Example: 9
params[Fax][Local]stringThe local part of the fax number.Example: 1235456
params[Fax][Extension]stringThe extension part of the fax number.Example: 789
params[Mobile][Country]stringThe country code for the mobile number.Example: 64
params[Mobile][Area]stringThe area code for the mobile number.Example: 21
params[Mobile][Local]stringThe local part of the mobile number.Example: 123456
params[Mobile][Extension]stringThe extension part of the mobile number.Example: 789

Code Samples

JavaScript PHP Rails Python
var xmlHttp = new XMLHttpRequest();
xmlHttp.open("POST", "https://api.sitehost.nz/1.3/srs/update_contact.json", false);

var data = new FormData();
data.append("apikey", "your_key_here");
data.append("client_id", "1");
data.append("contact_id", "1");
data.append("params[Name]", "Example");
data.append("params[Email]", "example@example.com");
data.append("params[PostalAddress]", "1 Example Rd");
data.append("params[PostalAddress2]", "Round the bend");
data.append("params[Suburb]", "Ellerslie");
data.append("params[City]", "Auckland");
data.append("params[Country]", "NZ");
data.append("params[PostCode]", "612");
data.append("params[Province]", "Ellerslie");
data.append("params[Organization]", "Example Corp.");
data.append("params[Phone][Country]", "64");
data.append("params[Phone][Area]", "9");
data.append("params[Phone][Local]", "123456");
data.append("params[Phone][Extension]", "789");
data.append("params[Fax][Country]", "64");
data.append("params[Fax][Area]", "9");
data.append("params[Fax][Local]", "1235456");
data.append("params[Fax][Extension]", "789");
data.append("params[Mobile][Country]", "64");
data.append("params[Mobile][Area]", "21");
data.append("params[Mobile][Local]", "123456");
data.append("params[Mobile][Extension]", "789");

xmlHttp.send(data);

var response = xmlHttp.responseText;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api.sitehost.nz/1.3/srs/update_contact.json");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
$body = array(
'apikey' => 'your_key_here',
'client_id' => 1,
'contact_id' => 1,
'params[Name]' => 'Example',
'params[Email]' => 'example@example.com',
'params[PostalAddress]' => '1 Example Rd',
'params[PostalAddress2]' => 'Round the bend',
'params[Suburb]' => 'Ellerslie',
'params[City]' => 'Auckland',
'params[Country]' => 'NZ',
'params[PostCode]' => '612',
'params[Province]' => 'Ellerslie',
'params[Organization]' => 'Example Corp.',
'params[Phone][Country]' => '64',
'params[Phone][Area]' => '9',
'params[Phone][Local]' => '123456',
'params[Phone][Extension]' => '789',
'params[Fax][Country]' => '64',
'params[Fax][Area]' => '9',
'params[Fax][Local]' => '1235456',
'params[Fax][Extension]' => '789',
'params[Mobile][Country]' => '64',
'params[Mobile][Area]' => '21',
'params[Mobile][Local]' => '123456',
'params[Mobile][Extension]' => '789',
);
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/update_contact.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,
"contact_id" => 1,
"params[Name]" => "Example",
"params[Email]" => "example@example.com",
"params[PostalAddress]" => "1 Example Rd",
"params[PostalAddress2]" => "Round the bend",
"params[Suburb]" => "Ellerslie",
"params[City]" => "Auckland",
"params[Country]" => "NZ",
"params[PostCode]" => "612",
"params[Province]" => "Ellerslie",
"params[Organization]" => "Example Corp.",
"params[Phone][Country]" => "64",
"params[Phone][Area]" => "9",
"params[Phone][Local]" => "123456",
"params[Phone][Extension]" => "789",
"params[Fax][Country]" => "64",
"params[Fax][Area]" => "9",
"params[Fax][Local]" => "1235456",
"params[Fax][Extension]" => "789",
"params[Mobile][Country]" => "64",
"params[Mobile][Area]" => "21",
"params[Mobile][Local]" => "123456",
"params[Mobile][Extension]" => "789",
}
request.set_form_data(body)

response = http.request(request)
import requests
from collections import OrderedDict

uri = 'https://api.sitehost.nz/1.3/srs/update_contact.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['contact_id'] = 1
body['params[Name]'] = 'Example'
body['params[Email]'] = 'example@example.com'
body['params[PostalAddress]'] = '1 Example Rd'
body['params[PostalAddress2]'] = 'Round the bend'
body['params[Suburb]'] = 'Ellerslie'
body['params[City]'] = 'Auckland'
body['params[Country]'] = 'NZ'
body['params[PostCode]'] = '612'
body['params[Province]'] = 'Ellerslie'
body['params[Organization]'] = 'Example Corp.'
body['params[Phone][Country]'] = '64'
body['params[Phone][Area]'] = '9'
body['params[Phone][Local]'] = '123456'
body['params[Phone][Extension]'] = '789'
body['params[Fax][Country]'] = '64'
body['params[Fax][Area]'] = '9'
body['params[Fax][Local]'] = '1235456'
body['params[Fax][Extension]'] = '789'
body['params[Mobile][Country]'] = '64'
body['params[Mobile][Area]'] = '21'
body['params[Mobile][Local]'] = '123456'
body['params[Mobile][Extension]'] = '789'

response = requests.post(uri, data=body)

Response

200:

application/json
{
  "return": {
    "ContactID": "383",
    "ClientID": "1",
    "Name": "Example",
    "RegistrantName": "Example",
    "PostalAddress": "1 Example Rd",
    "PostalAddress2": "Round the bend",
    "Suburb": "Ellerslie",
    "PostCode": "0612",
    "Province": "Ellerslie",
    "City": "Auckland",
    "Country": "NZ",
    "PhoneCountry": "64",
    "PhoneArea": "9",
    "PhoneLocal": "123456",
    "PhoneExtension": "789",
    "MobileCountry": "64",
    "MobileArea": "9",
    "MobileLocal": "123456",
    "MobileExtension": "789",
    "FaxCountry": "64",
    "FaxArea": "9",
    "FaxLocal": "123456",
    "FaxExtension": "789",
    "Email": "example@example.co.nz",
    "Phone": "64-09-123456",
    "Fax": "64-09-123456",
    "Mobile": "64-09-123456",
    "DomainCount": "2",
    "RegistrantCount": "2"
  },
  "msg": "Successful",
  "status": true
}