Domains : contacts
Omschrijving
Wijzig de contacten (admin, tech en billing) van een een domeinnaamEndpoint
PUT https://api.nextname.nl/v2/domains/domain/contacts
Parameters
| Parameter | Datatype | Verplicht | Omschrijving |
|---|---|---|---|
| contacts | array | Ja | array met objecten nieuwe contacten: type: Type van het contact: admin, tech of billing handle: De handle van het contact |
Antwoord
HTTP status code: 204 No Content
Voorbeelden
Beschrijving:
Wijzig de contacten van een .NL domeinnaam, .NL domeinnaam heeft geen billing contact, dus we wijzigen alleen het admin en tech contact
Opdracht in PHP:
<?php
$env = "live"; // live or test
$api_key = "XXXXXXXX-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
$api_url = "/v2/domains/testdomeinnaam.nl/contacts";
$api_host = $env === "live" ? "https://api.nextname.nl" : "https://api-test.nextname.nl";
$a_data = ["contacts" => [["type" => "admin", "handle" => "CONTACTHANDLE-1"],["type" => "tech", "handle" => "CONTACTHANDLE-1"]]];
$json_data = json_encode($a_data);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $api_host . $api_url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PUT");
curl_setopt( $ch, CURLOPT_POSTFIELDS, $json_data );
curl_setopt($ch, CURLOPT_HTTPHEADER, array("Authorization: Bearer $api_key","Content-Type: application/json"));
$output = curl_exec($ch);
if(curl_getinfo($ch, CURLINFO_HTTP_CODE) === 204) {
echo "Contacts successfully updated";
}
curl_close($ch);
Opdracht in cURL:
curl -X PUT -H "Content-Type: application/json" -H "Authorization: Bearer XXXXXXXX-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" \
-d '{"contacts":[{"type":"admin","handle":"CONTACTHANDLE-1"},{"type":"tech","handle":"CONTACTHANDLE-1"}]}' \
https://api-test.nextname.nl/v2/domains/testdomeinnaam.nl/contacts
HTTP/1.1 204 No Content
Beschrijving:
Wijzig de contacten van een .COM domeinnaam
Opdracht in PHP:
<?php
$env = "live"; // live or test
$api_key = "XXXXXXXX-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
$api_url = "/v2/domains/testdomeinnaam.com/contacts";
$api_host = $env == "live" ? "https://api.nextname.nl" : "https://api-test.nextname.nl";
$a_data = ["contacts" => [["type" => "admin", "handle" => "CONTACTHANDLE-1"],["type" => "tech", "handle" => "CONTACTHANDLE-2"],["type" => "billing", "handle" => "CONTACTHANDLE-3"]]];
$json_data = json_encode($a_data);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $api_host . $api_url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PUT");
curl_setopt( $ch, CURLOPT_POSTFIELDS, $json_data );
curl_setopt($ch, CURLOPT_HTTPHEADER, array("Authorization: Bearer $api_key","Content-Type: application/json"));
$output = curl_exec($ch);
if(curl_getinfo($ch, CURLINFO_HTTP_CODE) === 204) {
echo "Contacts successfully updated";
}
echo $output;
Opdracht in cURL:
curl -X PUT -H "Content-Type: application/json" -H "Authorization: Bearer XXXXXXXX-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" \
-d '{"contacts":[{"type":"admin","handle":"CONTACTHANDLE-1"},{"type":"tech","handle":"CONTACTHANDLE-2"},{"type":"billing","handle":"CONTACTHANDLE-3"}]}' \
https://api-test.nextname.nl/v2/domains/testdomeinnaam.com/contacts
HTTP/1.1 204 No Content