Contacts : TLDdata add

  • Aangemaakt : 01-03-2023
  • Laatste update: -

Omschrijving

Voeg TLD specifieke parameters toe aan een contact

Endpoint


Parameters


Een overzicht van alle TLD specifieke parameters vind je op de pagina Extra parameters voor contacten

Antwoord

Voorbeeld


Beschrijving:
Voeg de TLD specifieke parameters voor SIDN (.NL) toe aan contact ABCD-0001: De rechtsvorm en het KvK-nummer

Opdracht in PHP:
<?php
$env      = "live"; // live or test
$api_key  = "XXXXXXXX-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
$api_url  = "/v2/contacts/ABCD-0001/tlddata/SIDN";
$api_host = $env === "live" ? "https://api.mijndomeinreseller.nl" : "https://api-test.mijndomeinreseller.nl";

$a_data = [
            "legal_form" => "BV",
            "legal_form_regno" => "12345678"
	  ];

$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_POST, true);
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 "TLDdata successfully added";
}

curl_close($ch);
Opdracht in cURL:
curl -X POST -H "Content-Type: application/json" -H "Authorization: Bearer XXXXXXXX-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" \
-d '{"legal_form":"BV","legal_form_regno":"12345678"}' \
https://api-test.mijndomeinreseller.nl/v2/contacts/ABCD-0001/tlddata/SIDN
Antwoord:
HTTP/1.1 204 No Content