API documentation

This document describes the UnoEuro RESTful JSON API.

Please note we reserve the right to block and ban users who abuse the API.


Authentication

The login information is given in the base URI and must be provided with each request.

Example: https://api.unoeuro.com/1/[ACCOUNTNAME]/[APIKEY]

URI arguments

1 The version of the API you are calling
accountname Your UnoEuro account name. Example: UE123456
apikey The API key given to your UnoEuro account. Can be found in your controlpanel.

Library

The following libraries are availiable for use.

PHP https://github.com/unoeuro/api-php

Testing

We recommend hurl.it for testing purposes.


GET /my/products/ - List products

Returns a list of all products for the given account.

Response codes

Every response has a 'status' and 'message' JSON component.

200 Everything went as expected
400 Something went wrong. See message field for more details.

Example request

GET https://api.unoeuro.com/1/[ACCOUNTNAME]/[APIKEY]/my/products/


POST /order/dnsservice/ - Order DNS Service

In order to place an order with us, a valid credit card is required to be set up and active in your UnoEuro controlpanel.

Request arguments

domain An array of information about the domain. array
domain[name] The name of the domain, in the format "example.com" string
domain[action] The action you wish to perform on the domain. Can be either "transfer" or "register". Must match status of given domain. string
password Optional. The given password you wish the product to have. If left empty a random password is generated. string
coupon Optional. string
autorenew Optional. Set the product to automatic renewal bool

Response codes

Every response has a 'status' and 'message' JSON component.

200 Everything went as expected
400 Something went wrong. See message field for more details.

Example request 1

POST https://api.unoeuro.com/1/[ACCOUNTNAME]/[APIKEY]/order/dnsservice
{ "password": "somepassword", "domain": { "name": "example.com", "action": "transfer" }, "autorenew": true }

Example request 1 (PHP)


<?php
    $json 
= array(
        
'password' => 'somepassword',
        
'domain' => array('name' => 'example.com''action' => 'transfer'),
        
'autorenew' => true,
    );
    
$ch curl_init('https://api.unoeuro.com/1/UE123456/654321/order/dnsservice/');
    
curl_setopt($chCURLOPT_CUSTOMREQUEST'POST');
    
curl_setopt($chCURLOPT_RETURNTRANSFERtrue);
    
curl_setopt($chCURLOPT_HTTPHEADER, array('Content-Type: application/json'));
    
curl_setopt($chCURLOPT_POSTFIELDSjson_encode($json));
    
$response curl_exec($ch);
    
$response_json json_decode($response);
    
var_dump($response_json);
?>

Example response 1

{
    "status": 200,
    "message": "success",
    "payment": {
        "amount": 100
    }
}

Example request 2 - Bulk register domains (PHP)


<?php
    $domains 
= array('example.com',
                     
'example.dk',
                     
'example.co.uk',
                     
'example.org',
                     
/* ... */
                    
);
    foreach ( 
$domains as $domain ) {
        
$json = array(
            
'domain' => array('name' => $domain'action' => 'register'),
            
'autorenew' => true,
        );
        
$ch curl_init('https://api.unoeuro.com/1/UE123456/654321/order/dnsservice/');
        
curl_setopt($chCURLOPT_CUSTOMREQUEST'POST');
        
curl_setopt($chCURLOPT_RETURNTRANSFERtrue);
        
curl_setopt($chCURLOPT_HTTPHEADER, array('Content-Type: application/json'));
        
curl_setopt($chCURLOPT_POSTFIELDSjson_encode($json));
        
$response curl_exec($ch);
        
$response_json json_decode($response);
        
var_dump($response_json);
        unset(
$ch);
    }
?>

GET /domaincheck/[domain] - Query domain availability status

Query the availability status of a domain.

URI arguments

domain The name of the domain, in the format "example.com". IDNA format recommended.

Response codes

Every response has a 'status' and 'message' JSON component.

200 Everything went as expected
400 Something went wrong. See message field for more details.

Example request

GET https://api.unoeuro.com/1/[ACCOUNTNAME]/[APIKEY]/domaincheck/example.com

Example request (PHP)


<?php
    $ch 
curl_init('https://api.unoeuro.com/1/UE123456/654321/domaincheck/example.com/');
    
curl_setopt($chCURLOPT_CUSTOMREQUEST'GET');
    
curl_setopt($chCURLOPT_RETURNTRANSFERtrue);
    
curl_setopt($chCURLOPT_HTTPHEADER, array('Content-Type: application/json'));
    
curl_setopt($chCURLOPT_POSTFIELDSjson_encode($json));
    
$response curl_exec($ch);
    
$response_json json_decode($response);
    
var_dump($response_json);
?>

Example response

{
    "status": 200,
    "message": "success",
    "domain": {
        "name": "example.com",
        "status": "taken",
        "available": false
    }
}

GET /my/products/[object]/dns - Get DNS zone

Get DNS zone.

URI arguments

object The object reference to the product. Found in the /my/products/ call.

Response codes

Every response has a 'status' and 'message' JSON component.

200 Everything went as expected
400 Something went wrong. See message field for more details.

Example request

GET https://api.unoeuro.com/1/[ACCOUNTNAME]/[APIKEY]/my/products/[OBJECT]/dns/


GET /my/products/[object]/dns/records - Get records from DNS zone

Get all DNS records from a DNS zone.

URI arguments

object The object reference to the product. Found in the /my/products/ call.

Response codes

Every response has a 'status' and 'message' JSON component.

200 Everything went as expected
400 Something went wrong. See message field for more details.

Example request

GET https://api.unoeuro.com/1/[ACCOUNTNAME]/[APIKEY]/my/products/[OBJECT]/dns/records/


POST /my/products/[object]/dns/records - Add record to DNS zone

Add a DNS record to a DNS zone.

URI arguments

object The object reference to the product. Found in the /my/products/ call.

Request arguments

name The name of the DNS record string
data The value of the DNS record string
type The type of DNS record to add (A, MX, CNAME etc.) string
ttl Optional. The amount of seconds for the TTL of the DNS record integer
priority The priority of the DNS record, where applies integer

Response codes

Every response has a 'status' and 'message' JSON component.

200 Everything went as expected
400 Something went wrong. See message field for more details.

Example request

POST https://api.unoeuro.com/1/[ACCOUNTNAME]/[APIKEY]/my/products/[OBJECT]/dns/records/
{ "name": "www", "type": "A", "data": "127.0.0.1", "priority": 0, "ttl": 3600 }


PUT /my/products/[object]/dns/records/[record_id] - Edit record in DNS zone

Edit a record in a a DNS zone.

URI arguments

object The object reference to the product. Found in the /my/products/ call.
record_id The ID of the DNS record, from the /dns/records/ call.

Request arguments

name The name of the DNS record string
data The value of the DNS record string
type The type of DNS record to add (A, MX, CNAME etc.) string
ttl Optional. The amount of seconds for the TTL of the DNS record. integer
priority The priority of the DNS record, where applies integer

Response codes

Every response has a 'status' and 'message' JSON component.

200 Everything went as expected
400 Something went wrong. See message field for more details.

Example request

PUT https://api.unoeuro.com/1/[ACCOUNTNAME]/[APIKEY]/my/products/[OBJECT]/dns/records/[RECORD_ID]
{ "name": "www", "type": "A", "data": "127.0.0.1", "priority": 0, "ttl": 3600 }


DELETE /my/products/[object]/dns/records/[record_id] - Delete record from DNS zone

Delete a record from a DNS zone.

URI arguments

object The object reference to the product. Found in the /my/products/ call.
record_id The ID of the DNS record, from the /dns/records/ call.

Response codes

Every response has a 'status' and 'message' JSON component.

200 Everything went as expected
400 Something went wrong. See message field for more details.

Example request

DELETE https://api.unoeuro.com/1/[ACCOUNTNAME]/[APIKEY]/my/products/[OBJECT]/dns/records/[RECORD_ID]


GET /my/sslcerts - List SSL certificates

Get a list of all SSL certificates.

Response codes

Every response has a 'status' and 'message' JSON component.

200 Everything went as expected
400 Something went wrong. See message field for more details.

Example request

GET https://api.unoeuro.com/1/[ACCOUNTNAME]/[APIKEY]/my/sslcerts/


POST /my/sslcerts/ - SSL certificate

Import SSL certificate to the account.

Request arguments

crt The certificate in x509 PEM format string
key The private key in x509 PEM format string
ca The certificate chain (intermediate certificate) in x509 PEM format string

Response codes

Every response has a 'status' and 'message' JSON component.

200 Everything went as expected
400 Something went wrong. See message field for more details.