Integraciones
🔌
Public API
Extrae conversaciones con mensajes y guarda en formato JSON. API REST de solo lectura.
Autenticación
Todas las llamadas requieren un header Authorization con tu API Key:
Header
Authorization: Bearer dnl_live_xxxxxxxxxxxxxxxxxxxxxxxxxx La API Key se genera desde Integraciones → Public API en el dashboard de Danil.
🧪
Playground incluido
En el dashboard de Public API hay un playground donde puedes editar los filtros del endpoint, ejecutarlo en vivo y guardar los resultados en JSON.
Endpoint
| Método | URL | Descripción |
|---|---|---|
| GET | /api/v1/public/conversations | Conversaciones con mensajes incluidos |
Base URL
https://gateway.danil.ai/api/v1/public Parámetros
| Parámetro | Tipo | Descripción |
|---|---|---|
| channel | string | Filtrar por canal: whatsapp, web, instagram, messenger |
| since | string | Fecha desde (ISO 8601). Ej: 2026-03-01T00:00:00 |
| until | string | Fecha hasta (ISO 8601). Ej: 2026-03-31T23:59:59 |
| include_messages | boolean | Si es true, incluye todos los mensajes de cada conversación |
| limit | integer | Resultados por página (opcional, sin límite por defecto) |
| page | integer | Número de página (opcional, requiere limit) |
Respuesta
JSON
{
"data": [
{
"id": 12345,
"agent_id": 1,
"status": "open",
"channel": "whatsapp",
"ai_assistance": true,
"contact": {
"id": 789,
"name": "Juan Pérez",
"identifier": "5215512345678",
"channel": "whatsapp"
},
"message_count": 14,
"messages": [
{
"id": 99001,
"direction": "inbound",
"source": "whatsapp",
"sender_type": "contact",
"content": "Hola, necesito ayuda",
"content_type": "text",
"media_url": null,
"created_at": "2026-03-15T14:30:00-06:00"
},
{
"id": 99002,
"direction": "outbound",
"source": "api",
"sender_type": "ai",
"content": "¡Hola! ¿En qué puedo ayudarte?",
"content_type": "text",
"media_url": null,
"created_at": "2026-03-15T14:30:05-06:00"
}
],
"created_at": "2026-03-15T14:28:00-06:00"
}
]
} Campos del mensaje:
| Campo | Valores |
|---|---|
| direction | inbound (del contacto) o outbound (del agente/IA) |
| sender_type | contact, ai, o human |
| content_type | text, image, audio, video, document |