Het werkt niet in test modus. Dit is de code
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api.transip.nl/v6/domains?test=1');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, "\n{\n \"domainName\": \"example.com\",\n \"contacts\": [\n {\n \"type\": \"registrant\",\n \"firstName\": \"John\",\n \"lastName\": \"Doe\",\n \"companyName\": \"Example B.V.\",\n \"companyKvk\": \"83057825\",\n \"companyType\": \"BV\",\n \"street\": \"Easy street\",\n \"number\": \"12\",\n \"postalCode\": \"1337 XD\",\n \"city\": \"Leiden\",\n \"phoneNumber\": \"+31 715241919\",\n \"faxNumber\": \"+31 715241919\",\n \"email\": \"[email protected]\",\n \"country\": \"nl\"\n }\n ],\n \"nameservers\": [\n {\n \"hostname\": \"ns0.transip.nl\",\n \"hostname\" : \"ns1.transip.nl\",\n \"ipv4\": \"\",\n \"ipv6\": \"\"\n }\n ],\n \"dnsEntries\": [\n {\n \"name\": \"www\",\n \"expire\": 86400,\n \"type\": \"A\",\n \"content\": \"127.0.0.1\"\n }\n ]\n} \n");
$headers = array();
$headers[] = 'Content-Type: application/json';
$headers[] = 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGci.........(json web key)';
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$result = curl_exec($ch);
if (curl_errno($ch)) {
echo 'Error:' . curl_error($ch);
}
curl_close($ch);
echo $result;
Ik krijg dit terug:
{"error":"There seems to be a problem with your nameservers:
- You need to specify at least 2 name servers for the domain 'example.com'."}
Ze geven geen support hierop, dus weet iemand wat het probleem is?