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.
First, add the ADAC client to the body of your webshop. Preferably on the bottom, this ensures that all elements are loaded before loading ADAC.
<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>
const API_KEY = '{YOUR_API_KEY}';
adac.initialize(API_KEY, {
TLD_SET_TOKEN: '{A_TLD_SET_TOKEN}'
});
</script>
Now add either the following elements to your page:
<input id="adac-js-domain-input" type="text" >
<div id="adac-js-categories"></div>
<div id="adac-js-domain-results"></div>
<div id="adac-js-suggestions"></div>
Or set your own custom elements by overwriting the inputElement
, resultsElement
,
suggestionElement
and categoriesElement
parameters during initialization e.g.:
<script>
const API_KEY = '{YOUR_API_KEY}';
adac.initialize(API_KEY, {
TLD_SET_TOKEN: '{A_TLD_SET_TOKEN}',
inputElement: document.getElementById('your-custom-input-id'),
resultsElement: document.getElementById('your-custom-results-element-id'),
suggestionElement: document.getElementById('your-custom-suggestion-element-id'),
categoriesElement: document.getElementById('your-custom-categories-element-id')
});
</script>
The ADAC API has two entry points, one for a WebSocket connection and one for XMLHttpRequests (AJAX calls). We highly recommend the WebSocket, the AJAX endpoint is only provided to support legacy browsers that do not support WebSockets.
The ADAC API has three types of actions: