Need help? Call Live Support at +31 (0) 38 453 07 59

This page assists you in implementing ADAC to your webshop. There are two ways to integrate ADAC within your webshops. Namely, using our JavaScript client or by connecting directly to the ADAC API. HTTP requests and web sockets can be used in either methods.

Implementing via ADAC's javaScript client
Complexity level: Easy
  • First, add the ADAC client to the body of your webshop.
    <script src="https://adac.api.yoursrs.com/static/client.js"></script>
  • Then, add the following snippet and fill in the API_KEY and TLD_SET_TOKEN (you can find your API_KEY and a TLD_SET_TOKEN in the ADAC Management Panel).
    
                <script>
                    var API_KEY = '{YOUR_API_KEY}';
                    adac.initialize(API_KEY, {
                        TLD_SET_TOKEN: '{A_TLD_SET_TOKEN}',
                        inputElement: document.getElementById('adac-js-domain-input'),
                        resultsElement: document.getElementById('adac-js-domain-results'),
                        suggestionElement: document.getElementById('adac-js-suggestions'),
                        categoriesElement: document.getElementById('adac-js-categories')});
                </script>
            


Installation via the ADAC API
Complexity level: Intermediate
  • The ADAC API has two entry points, one for a WebSocket connection and one for XMLHttpRequests (AJAX calls).
  • WebSockets: wss://adac.api.yoursrs.com/ws All commands through WebSockets are POST'ed via XMLHttpRequests. Responses will be automatically returned via the WebSocket connection.
  • XMLHttpRequests: https://adac.api.yoursrs.com/ajax You can do a GET to the XMLHttpRequest entry point to fetch new data from the API. If there is no data the connection will be held open until it timeouts (long-polling). You can do a new GET in that case.
Some request & responses:

The ADAC API accepts commands in the following JSON format and also responds in JSON format:


                {
                "api_key": "{YOUR_API_KEY}",
                "action": "{ACTION}",
                "data": "{DATA}"
                }
        

Request To fetch available categories, 'action' should be 'categories' and 'data' can be left empty.


                {
                    "api_key": "{YOUR_API_KEY}",
                    "action": "categories",
                    "data": ""
                }
            
Response

                {
                    "action": "categories",
                    "data":
                        [
                            [1, "First category"],
                            [2, "Second category"]
                        ]
                }
            

Request To do actual checks on domain names, 'action' should be 'input' and 'data' should be a dict containing a 'tld_set_token', 'categories' and the 'input' which is supplied by the user. Possible domain statuses: 0 = waiting, 1 = available, 2 = taken, 3 = invalid, 4 = error, 5 = unknown


            {
                "api_key": "{YOUR_API_KEY}",
                "action": "input",
                "data":
                    {
                        tld_set_token: "{A_TLD_SET_TOKEN}",
                        categories: [1, 2],
                        input: "example.com"
                    }
            }
        

Response Note that suffix is the tld


            {
                "action": "domain_status",
                "data":
                    {
                        status: 0,
                        suffix: "com",
                        domain_name: "example.com"
                    }
            }
        

An error response


                {
                    "action": "error",
                    "data": "Invalid domain"
                }