API documentation

Additional information


Connecting to the API using PHP (Example 1 - HTTP Request)

<?php

// PEAR Module : HTTP_Request
require_once("HTTP/Request.php");

//Environment
define('ENVIRONMENT','TEST');

switch (
ENVIRONMENT)
{
    case 
'TEST':
        
$login_username 'your_username';
        
$login_password 'your_password';
        
$login_url 'https://secure.tryout-eurodns.com:20015/v2/';
        
$subuser_identifier null;
    break;
    
    case 
'PROD':
        
$login_username 'your_username';
        
$login_password 'your_password';
        
$login_url 'https://secure.api-eurodns.com:20015/v2/';
        
$subuser_identifier null;
    break;    
    
    default:
        die(
"Invalid environment specified");
    break;
}    

//XML Code
$xml =    
<<<HEREDOC
<?xml version="1.0" encoding="UTF-8"?>
<request xmlns:agent="http://www.eurodns.com/agent">
    <agent:balance />
</request>
HEREDOC;
    
//Connect
$req = &new HTTP_Request($login_url, array
(
    
'user' => $login_username,    
    
'pass' => 'MD5'.md5($login_password)
));

//Request method, mandatory
$req->setMethod(HTTP_REQUEST_METHOD_POST);

//Request code, mandatory
$req->addPostData('xml'urlencode($xml));    

//Request SubUser identifier, optional 
if ( ! empty ($subuser_identifier) AND is_numeric ($subuser_identifier))
{
    
$req->addPostData('subUserID'$subuser_identifier);    
}

//Send request
$req->sendRequest();

//Get response
$response $req->getResponseBody();

?>