API documentation

Additional information


Connecting to the API using PHP cURL

<?php

//Options
$useTestServer false;

//Test server
if ($useTestServer)
{
    
define ("URL""https://secure.tryout-eurodns.com:20015/v2/");
    
define ("USERNAME""YOUR_TEST_SERVER_USERNAME");
    
define ("PASSWORD""MD5".md5("YOUR_TEST_SERVER_PASSWORD"));
}
//Production server
else
{
    
define ("URL""https://secure.api-eurodns.com:20015/v2/");
    
define ("USERNAME""YOUR_PRODUCTION_SERVER_USERNAME");
    
define ("PASSWORD""MD5".md5("YOUR_PRODUCTION_SERVER_PASSWORD"));
}

//Initialise
$cUrl curl_init();

//Username and password
curl_setopt ($cUrlCURLOPT_USERPWDUSERNAME ":" PASSWORD);

//API Server URL
curl_setopt ($cUrlCURLOPT_URLURL);

//Verify SSL certificate 
curl_setopt ($cUrlCURLOPT_SSL_VERIFYPEER1);

//Verify SSL host?
curl_setopt ($cUrlCURLOPT_SSL_VERIFYHOST1);

//Show debug information?
curl_setopt ($cUrlCURLOPT_VERBOSE0);

//Return result instead of displaying it?
curl_setopt ($cUrlCURLOPT_RETURNTRANSFER1);

//XML request
$xml =    
<<<HEREDOC
<?xml version="1.0" encoding="UTF-8"?>
<request xmlns:agent="http://www.eurodns.com/agent">
    <agent:balance />
</request>
HEREDOC;

//Send POST?
curl_setopt ($cUrlCURLOPT_POST1);

//POST Options
curl_setopt ($cUrlCURLOPT_POSTFIELDS'xml='.urlencode (urlencode ($xml)));

//Execute
$result curl_exec ($cUrl);

//Error
if (curl_errno ($cUrl) <> 0)
{
    die(
"CURL error [".curl_errno ($cUrl)."]");
}

//Display result
echo $result;

?>