/srs/update_company_info


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

Updates company information.

Form Parameters

ParameterTypeRequiredDescription
client_idintegerYesThe ID for the client.Example: 1
params[CompanyName]stringThe company name.Example: SiteHost
params[CompanyUrl]stringThe company URL.Example: http://www.sitehost.co.nz
params[CompanyRenewUrl]stringThe domain renewal URL.Example: http://www.sitehost.co.nz
params[CompanyEmail]stringThe email address.Example: domains@sitehost.co.nz
params[CompanyEmailFrom]stringThe from email address.Example: support@sitehost.co.nz
params[CompanyEmailFromName]stringThe from name for emails.Example: SiteHost
params[CompanySupportEmail]stringThe support email address.Example: support@sitehost.co.nz
params[CompanyPhone]stringThe phone number.Example: +64 09 974 2182
params[CompanyFax]stringThe company fax number.Example: +64 09 525 7566
params[SendRenewedEmail]integerThe renew email option. 1 for yes and 0 for noExample: 1

Code Samples

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

var data = new FormData();
data.append("apikey", "your_key_here");
data.append("client_id", "1");
data.append("params[CompanyName]", "SiteHost");
data.append("params[CompanyUrl]", "http://www.sitehost.co.nz");
data.append("params[CompanyRenewUrl]", "http://www.sitehost.co.nz");
data.append("params[CompanyEmail]", "domains@sitehost.co.nz");
data.append("params[CompanyEmailFrom]", "support@sitehost.co.nz");
data.append("params[CompanyEmailFromName]", "SiteHost");
data.append("params[CompanySupportEmail]", "support@sitehost.co.nz");
data.append("params[CompanyPhone]", "+64 09 974 2182");
data.append("params[CompanyFax]", "+64 09 525 7566");
data.append("params[SendRenewedEmail]", "1");

xmlHttp.send(data);

var response = xmlHttp.responseText;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api.sitehost.nz/1.3/srs/update_company_info.json");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
$body = array(
'apikey' => 'your_key_here',
'client_id' => 1,
'params[CompanyName]' => 'SiteHost',
'params[CompanyUrl]' => 'http://www.sitehost.co.nz',
'params[CompanyRenewUrl]' => 'http://www.sitehost.co.nz',
'params[CompanyEmail]' => 'domains@sitehost.co.nz',
'params[CompanyEmailFrom]' => 'support@sitehost.co.nz',
'params[CompanyEmailFromName]' => 'SiteHost',
'params[CompanySupportEmail]' => 'support@sitehost.co.nz',
'params[CompanyPhone]' => '+64 09 974 2182',
'params[CompanyFax]' => '+64 09 525 7566',
'params[SendRenewedEmail]' => 1,
);
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_company_info.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,
"params[CompanyName]" => "SiteHost",
"params[CompanyUrl]" => "http://www.sitehost.co.nz",
"params[CompanyRenewUrl]" => "http://www.sitehost.co.nz",
"params[CompanyEmail]" => "domains@sitehost.co.nz",
"params[CompanyEmailFrom]" => "support@sitehost.co.nz",
"params[CompanyEmailFromName]" => "SiteHost",
"params[CompanySupportEmail]" => "support@sitehost.co.nz",
"params[CompanyPhone]" => "+64 09 974 2182",
"params[CompanyFax]" => "+64 09 525 7566",
"params[SendRenewedEmail]" => 1,
}
request.set_form_data(body)

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

uri = 'https://api.sitehost.nz/1.3/srs/update_company_info.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['params[CompanyName]'] = 'SiteHost'
body['params[CompanyUrl]'] = 'http://www.sitehost.co.nz'
body['params[CompanyRenewUrl]'] = 'http://www.sitehost.co.nz'
body['params[CompanyEmail]'] = 'domains@sitehost.co.nz'
body['params[CompanyEmailFrom]'] = 'support@sitehost.co.nz'
body['params[CompanyEmailFromName]'] = 'SiteHost'
body['params[CompanySupportEmail]'] = 'support@sitehost.co.nz'
body['params[CompanyPhone]'] = '+64 09 974 2182'
body['params[CompanyFax]'] = '+64 09 525 7566'
body['params[SendRenewedEmail]'] = 1

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

Response

200:

application/json
{
  "return": {
    "ClientID": "1",
    "CompanyName": "SiteHost",
    "CompanyUrl": "http://www.sitehost.co.nz",
    "CompanyRenewUrl": "http://www.sitehost.co.nz",
    "CompanyEmail": "domains@sitehost.co.nz",
    "CompanyEmailFrom": "support@sitehost.co.nz",
    "CompanyEmailFromName": "SiteHost",
    "CompanySupportEmail": "domains@sitehost.co.nz",
    "CompanyPhone": "+64 09 974 2182",
    "CompanyFax": "+64 09 525 7566",
    "SendRenewedEmail": "1",
    "SendInvoice": "1"
  },
  "msg": "Successful.",
  "status": true
}