fb-pixel

API Call: Modifica nameservers (Reseller domini)


Questa chiamata consente di inviare un comando per modificare i nameservers di un dominio.

Parametri della richiesta

Parametro
Tipo
Descrizione
Richiesto
domain
stringa
Il nome del dominio
Richiesto
ns1
stringa
Il nameserver per il tuo dominio, ad es: ns1.dominio.it
Richiesto
ns2
stringa
Il nameserver per il tuo dominio, ad es: ns1.dominio.it
Richiesto
ns3
stringa
Il nameserver per il tuo dominio, ad es: ns1.dominio.it
Opzionale
ns4
stringa
Il nameserver per il tuo dominio, ad es: ns1.dominio.it
Opzionale
ns5
stringa
Il nameserver per il tuo dominio, ad es: ns1.dominio.it
Opzionale

Parametri della risposta

Parametro
Tipo
Descrizione
result
stringa
Il risultato dell’operazione: success o error

Esempio di richiesta (PHP cUrl)

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://my.supporthost.com/domainapi.php/domain/nameservers',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS =>'{
    "domain": "dominio.it",
    "ns1": "ns1.supporthost.com",
    "ns2": "ns2.supporthost.com"
}',
  CURLOPT_HTTPHEADER => array(
    'X-Email: your_email',
    'X-Api-Key: your_apikey'
  ),
));

$response = curl_exec($curl);

curl_close($curl);

Esempio di risposta (JSON)

{
    "result": "success",
}

Risposte di errore

  • Connection refused from unauthorized host. IP xxx.xxx.xxx.xxx is NOT allowed to access your account
  • Invalid email or not a reseller.
  • Invalid API key.
  • Domain not found in your account
  • The status of the domain doesn’t allow nameservers change

Prova gratis e senza impegno uno dei nostri piani hosting per 14 giorni. Non è richiesto nessun dato di pagamento!