Technical documentation
Accessibility widget integration manual and domain management API reference.
Widget integration
Automatic loading (Plug & Play)
Basic implementation with no additional configuration. The widget loads immediately with default values.
You do not need a separate CSS link: the script injects the stylesheet automatically (same base path as the `.js`). You may still keep a `` in `
` to download CSS and JS in parallel.<script defer src="https://api.addaw.org/addaw-wba11y.min.js"></script>
API initialization (Recommended)
Allows defining delays and custom visual configurations from JavaScript.
<script defer src="https://api.addaw.org/addaw-wba11y.min.js"></script>
<script defer>
Addaw.init({
delay: 5000,
position: 'left',
dark_mode: '1',
lang: 'es',
logo_url: 'https://yoursite.com/logo.png',
logo_link: 'https://yoursite.com'
});
</script>
Initialization parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
delay |
Number | 0 | Time in ms for lazy loading. |
position |
String | 'right' | Button position: left or right. |
dark_mode |
String / Bool | '0' | 1 to start in dark mode (if no memory). |
lang |
String | 'auto' | ISO language code (es, en, fr...). |
autoInit |
Boolean | true | If false, the widget waits to be called manually. |
logo_url |
URL | ADDAW logo | Custom image for the widget footer. |
logo_link |
URL | https://addaw.org/es | Click destination for the custom logo. |
PanelDominioAlta, PanelDominioBaja o PanelDominioRenovacion que usan sesion web del panel. Para integraciones de terceros debes usar los endpoints ApiEmpleado* documentados aqui.
position, dark_mode, lang, autoInit, etc. Todas esas opciones se envian en un unico endpoint: ApiEmpleadoPersonalizarDominio.
Control methods (public API)
Use these commands from the console or your scripts to interact with the widget once loaded.
Addaw.initialized — Checks if the widget is active.
if (Addaw.initialized) {
console.log('Widget is active');
}
Addaw.destroy() — Completely removes the widget from the site.
Addaw.destroy();
Addaw.init({...}) — Re-initializes with new configuration.
Addaw.init({
position: 'left',
dark_mode: '1',
lang: 'en'
});
Configuration hierarchy
The widget follows a strict priority logic to apply settings:
Advanced manual control
For applications that require on-demand startup (for example, after pressing a specific button):
<script>
window.AddawConfig = { autoInit: false };
</script>
<script defer src="https://api.addaw.org/addaw-wba11y.min.js"></script>
<script defer>
document.addEventListener('DOMContentLoaded', function() {
Addaw.init({
position: 'right',
lang: 'es'
});
});
</script>
Domain management API
REST API for employees to manage domains linked to their account and customize the widget appearance and behavior (color palette and parameters equivalent to Addaw.init).
Endpoints disponibles (API empleado)
| Metodo | Endpoint | Descripcion |
|---|---|---|
| POST | /webService/ApiEmpleadoLogin |
Autentica y devuelve access_token tipo Bearer. |
| GET | /webService/ApiEmpleadoPing |
Comprueba validez del token y estado operativo. |
| POST | /webService/ApiEmpleadoDominioAlta |
Alta de dominio (idempotente, con control de cuota/plan activo). |
| POST | /webService/ApiEmpleadoDominioBaja |
Baja logica del dominio (marca activo=0). |
| GET | /webService/ApiEmpleadoMisDominios |
Lista dominios activos con su configuracion efectiva. |
| GET | /webService/ApiEmpleadoColoresDisponibles |
Lista paletas de color disponibles. |
| POST | /webService/ApiEmpleadoPersonalizarDominio |
Guarda color y opciones del widget por dominio. |
Quickstart backend (flujo recomendado)
- Autentica con
ApiEmpleadoLoginy guardaaccess_token. - Da de alta el dominio con
ApiEmpleadoDominioAlta. - Consulta paletas con
ApiEmpleadoColoresDisponibles. - Aplica configuracion con
ApiEmpleadoPersonalizarDominio. - Valida el resultado con
ApiEmpleadoMisDominios.
# Quickstart con curl (requiere jq)
TOKEN=$(curl -s -X POST "https://panel.addaw.org/webService/ApiEmpleadoLogin" \
-H "Content-Type: application/json" \
-d '{"correo":"tu_correo@ejemplo.com","pass":"tu_password"}' | jq -r '.access_token')
curl -s "https://panel.addaw.org/webService/ApiEmpleadoMisDominios" \
-H "Authorization: Bearer ${TOKEN}"
Authentication
All requests (except login) require a Bearer token in the Authorization header.
https://panel.addaw.org/webService/ApiEmpleadoLogin$ch = curl_init('https://panel.addaw.org/webService/ApiEmpleadoLogin');
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Content-Type: application/json',
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([
'correo' => 'tu_correo@ejemplo.com',
'pass' => 'tu_password',
]));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
$token = $response['access_token'];
Ping autenticado
Endpoint recomendado para verificar token y conectividad antes de operaciones de dominio.
https://panel.addaw.org/webService/ApiEmpleadoPingcurl -X GET "https://panel.addaw.org/webService/ApiEmpleadoPing" \
-H "Authorization: Bearer $TOKEN"
Respuesta esperada: ok, datos del empleado y server_time.
Register a domain
Register a new domain linked to your account. The operation is idempotent: if the domain already exists, it is not duplicated.
https://panel.addaw.org/webService/ApiEmpleadoDominioAlta$ch = curl_init('https://panel.addaw.org/webService/ApiEmpleadoDominioAlta');
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Authorization: Bearer ' . $token,
'Content-Type: application/json',
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode(['dominio' => 'www.example.com']));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
Deactivate a domain
Deactivates a domain. It is not deleted, it is marked as inactive.
https://panel.addaw.org/webService/ApiEmpleadoDominioBaja$ch = curl_init('https://panel.addaw.org/webService/ApiEmpleadoDominioBaja');
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Authorization: Bearer ' . $token,
'Content-Type: application/json',
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode(['dominio' => 'www.example.com']));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
Get my domains
Returns the list of active domains linked to your account.
https://panel.addaw.org/webService/ApiEmpleadoMisDominios$ch = curl_init('https://panel.addaw.org/webService/ApiEmpleadoMisDominios');
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Authorization: Bearer ' . $token,
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
List available colors
Returns the names and IDs of available color palettes to customize the widget.
https://panel.addaw.org/webService/ApiEmpleadoColoresDisponibles$ch = curl_init('https://panel.addaw.org/webService/ApiEmpleadoColoresDisponibles');
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Authorization: Bearer ' . $token,
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
Customize a domain
Stores widget settings for a domain: color palette and, optionally, the same parameters supported by Addaw.init (language, dark mode, position, auto-start, logos, delay, and modal content focus). The first request must include the palette id `color`; later requests may omit it to keep saved colors, or update only some fields. To clear a stored value and fall back to the widget defaults, send the key as `null`.
JSON body parameters
In addition to `dominio`, you may include the following fields. Names match the widget API (`autoInit` and `focusOnContent`; `auto_init` and `focus_on_content` are also accepted).
| Parameter | Type | Description |
|---|---|---|
color |
integer |
Palette id from the available-colors list. Required the first time the domain is configured; if omitted on later calls, previously stored colors are kept. |
lang |
string | null |
Two-letter ISO 639-1 code (e.g. `es`) or `null` for the widget default. |
dark_mode |
boolean | null |
`true` / `false`, `1` / `0`, or `null` (initial dark mode; respects existing browser preferences). |
position |
string | null |
`left`, `right`, or `null`. |
autoInit / auto_init |
boolean | null |
`true` / `false`, `1` / `0`, or `null` (auto-start when the script loads). |
logo_url |
string | null |
Footer logo URL (http, https, absolute path, or `./` relative) or `null`. |
logo_link |
string | null |
Click-through URL for the logo or `null`. |
delay |
integer | null |
Integer milliseconds from 0 to 86400000 to delay startup, or `null`. |
focusOnContent / focus_on_content |
boolean | null |
`true` / `false`, `1` / `0`, or `null` (focus on inner modal content). |
When serving `addaw-wba11y.min.js` from the CDN, the domain is taken from the Referer header. If options are stored for that domain, `window.AddawConfig = { ... };` is prepended to the script so they apply before auto-start (the user may still override via local storage, per the hierarchy described in the widget section).
https://panel.addaw.org/webService/ApiEmpleadoPersonalizarDominio$ch = curl_init('https://panel.addaw.org/webService/ApiEmpleadoPersonalizarDominio');
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Authorization: Bearer ' . $token,
'Content-Type: application/json',
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([
'dominio' => 'example.com',
'color' => 2,
'lang' => 'es',
'position' => 'left',
]));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
// Ejemplo JavaScript con fetch
await fetch('https://panel.addaw.org/webService/ApiEmpleadoPersonalizarDominio', {
method: 'POST',
headers: {
'Authorization': `Bearer ${token}`,
'Content-Type': 'application/json'
},
body: JSON.stringify({
dominio: 'example.com',
color: 2,
lang: 'es',
position: 'left',
autoInit: true,
dark_mode: false,
logo_url: 'https://example.com/logo.svg',
logo_link: 'https://example.com',
delay: 1200,
focusOnContent: true
})
});
Errores comunes y buenas practicas
Authorization: Bearer ... es obligatoria.
- Si quieres limpiar un valor almacenado para un dominio, envia esa clave con
null. - Usa siempre HTTPS y valida la expiracion del token en tu backend.
- La alta de dominio es idempotente: si ya existe, no se duplica.
- Al servir el widget por CDN, verifica que el dominio de
Referercoincide con el esperado.
Endpoint de estadisticas del widget
Ademas de la API de dominios, el widget envia agregados diarios de uso a:
https://api.addaw.org/webService/widgetInteractionStatsEste endpoint acepta JSON con events y suma contadores por dominio/dia/accion. Solo procesa claves permitidas (por ejemplo panel_open, tool_*, profile_*, blind_*).
await fetch('https://api.addaw.org/webService/widgetInteractionStats', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
events: {
panel_open: 1,
panel_close: 1,
tool_zoom: 3,
profile_dyslexia: 1
}
})
});
Origin o Referer para detectar dominio. Si no hay dominio valido, responde 204 sin persistir datos.
Como obtener estadisticas por dominio
En la API publica actual no existe un endpoint ApiEmpleado* especifico para leer series historicas de estadisticas por dominio con Bearer. La consulta por dominio se resuelve hoy desde el panel interno.
1) Vista de analitica por dominio (panel)
/Widget/Dominios/{domainNormalized}Esta ruta requiere sesion de panel y muestra metricas de cargas e interacciones del dominio.
desde: fecha inicio en formatoYYYY-MM-DD.hasta: fecha fin en formatoYYYY-MM-DD.- Si no se envian, el panel usa por defecto los ultimos 30 dias.
- Rango maximo permitido por el backend: 90 dias.
# Ejemplo (navegador con sesion iniciada en panel)
https://panel.addaw.org/Widget/Dominios/example.com?desde=2026-04-01&hasta=2026-04-20
2) Metricas calculadas en esa vista
widget_domain_loads_daily (dias cerrados) y widget_domain_loads (dia en curso).
widget_interaction_daily con filtros por action_key.
panel_open y panel_close en el top principal).
3) Consulta directa en BBDD (entornos internos)
-- Cargas diarias de un dominio
SELECT stat_date AS dia, SUM(request_count) AS total
FROM widget_domain_loads_daily
WHERE domain_normalized = 'example.com'
AND stat_date BETWEEN '2026-04-01' AND '2026-04-20'
GROUP BY stat_date
ORDER BY stat_date;
-- Interacciones diarias de un dominio
SELECT stat_date AS dia, SUM(event_count) AS total
FROM widget_interaction_daily
WHERE domain_normalized = 'example.com'
AND stat_date BETWEEN '2026-04-01' AND '2026-04-20'
GROUP BY stat_date
ORDER BY stat_date;
-- Top acciones por dominio
SELECT action_key, SUM(event_count) AS total
FROM widget_interaction_daily
WHERE domain_normalized = 'example.com'
AND stat_date BETWEEN '2026-04-01' AND '2026-04-20'
GROUP BY action_key
ORDER BY total DESC
LIMIT 15;
ApiEmpleadoEstadisticasDominio) con autenticacion Bearer y filtros de rango.