Domains : auto_renewal
Omschrijving
Wijzig de instellingen voor het automatisch verlengen van een domeinnaamEndpoint
PATCH https://api.nextname.nl/v2/domains/domain/auto_renewal
Parameters
| Parameter | Datatype | Verplicht | Omschrijving |
|---|---|---|---|
| auto_renewal | Boolean | Nee | Automatisch verlengen van de domeinnaam |
| auto_renewal_period | Integer | Nee | De periode waarmee de domeinnaam automatisch verlengd wordt |
Antwoord
HTTP status code: 204 No Content
Voorbeelden
Beschrijving:
Schakel de automatische verlenging uit voor een domeinnaam
Opdracht in PHP:
<?php
$env = "live"; // live or test
$api_key = "XXXXXXXX-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
$api_url = "/v2/domains/testdomeinnaam.nl/auto_renewal";
$api_host = $env == "live" ? "https://api.nextname.nl" : "https://api-test.nextname.nl";
$a_data = ["auto_renewal" => false];
$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, "PATCH");
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 "Auto renewal successfully disabled";
}
curl_close($ch);
Opdracht in cURL:
curl -X PATCH -H "Content-Type: application/json" -H "Authorization: Bearer XXXXXXXX-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" \
-d '{"auto_renewal":false}' \
https://api-test.nextname.nl/v2/domains/testdomeinnaam.nl/auto_renewal
HTTP/1.1 204 No Content
Beschrijving:
Wijzig de periode voor de automatische verlenging van een domeinnaam naar 3 maanden
Opdracht in PHP:
<?php
$env = "live"; // live or test
$api_key = "XXXXXXXX-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
$api_url = "/v2/domains/testdomeinnaam.be/auto_renewal";
$api_host = $env === "live" ? "https://api.nextname.nl" : "https://api-test.nextname.nl";
$a_data = ["auto_renew_period" => 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, "PATCH");
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 "Auto renewal period successfully modified";
}
curl_close($ch);
Opdracht in cURL:
curl -X PATCH -H "Content-Type: application/json" -H "Authorization: Bearer XXXXXXXX-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" \
-d '{"auto_renewal_period":3}' \
https://api-test.nextname.nl/v2/domains/testdomeinnaam.be/auto_renewal
HTTP/1.1 204 No Content