/srs/update_contact


POST https://api.sitehost.nz/1.0/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[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[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[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[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

Code Samples

JavaScript PHP Rails Python
var xmlHttp = new XMLHttpRequest();
xmlHttp.open("POST", "https://api.sitehost.nz/1.0/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[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[Phone][Country]", "64");
data.append("params[Phone][Area]", "9");
data.append("params[Phone][Local]", "123456");
data.append("params[Fax][Country]", "64");
data.append("params[Fax][Area]", "9");
data.append("params[Fax][Local]", "1235456");
data.append("params[Mobile][Country]", "64");
data.append("params[Mobile][Area]", "21");
data.append("params[Mobile][Local]", "123456");

xmlHttp.send(data);

var response = xmlHttp.responseText;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api.sitehost.nz/1.0/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[Suburb]' => 'Ellerslie',
'params[City]' => 'Auckland',
'params[Country]' => 'NZ',
'params[PostCode]' => '612',
'params[Province]' => 'Ellerslie',
'params[Phone][Country]' => '64',
'params[Phone][Area]' => '9',
'params[Phone][Local]' => '123456',
'params[Fax][Country]' => '64',
'params[Fax][Area]' => '9',
'params[Fax][Local]' => '1235456',
'params[Mobile][Country]' => '64',
'params[Mobile][Area]' => '21',
'params[Mobile][Local]' => '123456',
);
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.0/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[Suburb]" => "Ellerslie",
"params[City]" => "Auckland",
"params[Country]" => "NZ",
"params[PostCode]" => "612",
"params[Province]" => "Ellerslie",
"params[Phone][Country]" => "64",
"params[Phone][Area]" => "9",
"params[Phone][Local]" => "123456",
"params[Fax][Country]" => "64",
"params[Fax][Area]" => "9",
"params[Fax][Local]" => "1235456",
"params[Mobile][Country]" => "64",
"params[Mobile][Area]" => "21",
"params[Mobile][Local]" => "123456",
}
request.set_form_data(body)

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

uri = 'https://api.sitehost.nz/1.0/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[Suburb]'] = 'Ellerslie'
body['params[City]'] = 'Auckland'
body['params[Country]'] = 'NZ'
body['params[PostCode]'] = '612'
body['params[Province]'] = 'Ellerslie'
body['params[Phone][Country]'] = '64'
body['params[Phone][Area]'] = '9'
body['params[Phone][Local]'] = '123456'
body['params[Fax][Country]'] = '64'
body['params[Fax][Area]'] = '9'
body['params[Fax][Local]'] = '1235456'
body['params[Mobile][Country]'] = '64'
body['params[Mobile][Area]'] = '21'
body['params[Mobile][Local]'] = '123456'

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

Response

200:

application/json
{
  "return": {
    "ContactID": "383",
    "ClientID": "1",
    "Name": "Example",
    "RegistrantName": "Example",
    "PostalAddress": "1 Example Rd",
    "Suburb": "Ellerslie",
    "PostCode": "0612",
    "Province": "Ellerslie",
    "City": "Auckland",
    "Country": "NZ",
    "PhoneCountry": "0064",
    "PhoneArea": "09",
    "PhoneLocal": "123456",
    "MobileCountry": "",
    "MobileArea": "",
    "MobileLocal": "",
    "FaxCountry": "",
    "FaxArea": "",
    "FaxLocal": "",
    "Email": "example@example.com",
    "Phone": "0064-09-123456",
    "Fax": "--",
    "Mobile": "--",
    "DomainCount": "2",
    "RegistrantCount": "2"
  },
  "msg": "Successful",
  "status": true,
  "time": 40.62
}