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

Initialization parameters reference
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.
Nota: existen endpoints internos de panel como PanelDominioAlta, PanelDominioBaja o PanelDominioRenovacion que usan sesion web del panel. Para integraciones de terceros debes usar los endpoints ApiEmpleado* documentados aqui.
Importante: no existe un endpoint separado para 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:

1.º Persistence Browser memory (LocalStorage). If the user has already used it, their choice prevails.
2.º Manual API What the developer defines in Addaw.init().
3.º URL / Default Script src parameters or factory values.

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)

Employee API endpoints
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)

  1. Autentica con ApiEmpleadoLogin y guarda access_token.
  2. Da de alta el dominio con ApiEmpleadoDominioAlta.
  3. Consulta paletas con ApiEmpleadoColoresDisponibles.
  4. Aplica configuracion con ApiEmpleadoPersonalizarDominio.
  5. 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.

POSThttps://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.

GEThttps://panel.addaw.org/webService/ApiEmpleadoPing
curl -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.

POSThttps://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.

POSThttps://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.

GEThttps://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.

GEThttps://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).

JSON body parameters for domain customization
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).

POSThttps://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

En peticiones protegidas, la cabecera 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 Referer coincide con el esperado.

Endpoint de estadisticas del widget

Ademas de la API de dominios, el widget envia agregados diarios de uso a:

POSThttps://api.addaw.org/webService/widgetInteractionStats

Este 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
    }
  })
});
Este endpoint usa 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)

GET/Widget/Dominios/{domainNormalized}

Esta ruta requiere sesion de panel y muestra metricas de cargas e interacciones del dominio.

  • desde: fecha inicio en formato YYYY-MM-DD.
  • hasta: fecha fin en formato YYYY-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

Cargas del script Serie diaria combinando widget_domain_loads_daily (dias cerrados) y widget_domain_loads (dia en curso).
Interacciones del panel Serie diaria desde widget_interaction_daily con filtros por action_key.
Top acciones Ranking por accion (excluye 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;
Si necesitas exponer estas metricas por API publica para integraciones externas, lo recomendable es crear un endpoint nuevo de lectura (por ejemplo ApiEmpleadoEstadisticasDominio) con autenticacion Bearer y filtros de rango.

Start improving your website’s accessibility

Activate the solution or request expert support to move forward with confidence.

Contact

Tell us what you need; we will get back to you as soon as possible.

Sign in

Use your email and password or Google. You will be redirected to the panel.

Or continue with Google

No account yet?

Create your account

Sign up to manage the widget on your domains.

Continue with Google

Already have an account?