Domains : trade
Omschrijving
Wijzig de houder (registrant) van een domeinnaamEndpoint
PUT https://api.mijndomeinreseller.nl/v2/domains/domain/trade
Parameters
Parameter | Datatype | Verplicht | Omschrijving |
---|---|---|---|
registrant | String | Ja | Contact handle van de nieuwe registrant |
auth_code | String | Nee | Een auth_code is alleen vereist bij .BE domeinnamen |
Antwoord
HTTP status code: 204 No Content
Voorbeelden
Beschrijving:
Wijzig de houder van een .NL domeinnaam
Opdracht in PHP:
<?php $env = "live"; // live or test $api_key = "XXXXXXXX-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"; $api_url = "/v2/domains/testdomeinnaam.nl/trade"; $api_host = $env === "live" ? "https://api.mijndomeinreseller.nl" : "https://api-test.mijndomeinreseller.nl"; $a_data = ["registrant" => "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 "Trade successfully executed"; } curl_close($ch);
Opdracht in cURL:
curl -X PUT -H "Content-Type: application/json" -H "Authorization: Bearer XXXXXXXX-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" \ -d '{"registrant":"CONTACTHANDLE-1"}' \ https://api-test.mijndomeinreseller.nl/v2/domains/testdomeinnaam.nl/trade
HTTP/1.1 204 No Content
Beschrijving:
Wijzig de houder van een .BE domeinnaam met verplichte auth_code
Opdracht in PHP:
<?php $env = "live"; // live or test $api_key = "XXXXXXXX-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"; $api_url = "/v2/domains/testdomeinnaam.be/trade"; $api_host = $env == "live" ? "https://api.mijndomeinreseller.nl" : "https://api-test.mijndomeinreseller.nl"; $a_data = ["registrant" => "CONTACTHANDLE-1", "auth_code" => "123-456-789-012"]; $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 "Trade successfully executed"; } curl_close($ch);
Opdracht in cURL:
curl -X PUT -H "Content-Type: application/json" -H "Authorization: Bearer XXXXXXXX-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" \ -d '{"registrant":"CONTACTHANDLE-1", "auth_code":"123-456-789-012"}' \ https://api-test.mijndomeinreseller.nl/v2/domains/testdomeinnaam.be/trade
HTTP/1.1 204 No Content