DNS templates : Delete
Omschrijving
Met dit commando verwijder je een DNS templateEndpoint
DELETE https://api.nextname.nl/v2/dns/templates/dnstemplate
URL parameters
Bij dit commando worden geen extra parameters opgegevenAntwoord
HTTP status code: 204 No Content
Voorbeeld
Beschrijving:
Verwijder de DNS template 43d3fd8a4f45cbee
Opdracht in PHP:
<?php
$env = "live"; // live or test
$api_key = "XXXXXXXX-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
$api_url = "/v2/dns/templates/43d3fd8a4f45cbee";
$api_host = $env === "live" ? "https://api.nextname.nl" : "https://api-test.nextname.nl";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $api_host . $api_url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_setopt($ch, CURLOPT_HTTPHEADER, array("Authorization: Bearer $api_key"));
$response = curl_exec($ch);
if(curl_getinfo($ch, CURLINFO_HTTP_CODE) === 204) {
echo "Contact successfully deleted";
}
curl_close($ch);
Opdracht in cURL:
curl -X DELETE -H "Authorization: Bearer XXXXXXXX-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" \ https://api-test.nextname.nl/v2/dns/templates/43d3fd8a4f45cbee
HTTP/1.1 204 No Content