← Volver

BOTON API

Integra BOTON con tu CRM, servidor, o cualquier automatizacion. Envia mensajes de WhatsApp, lee conversaciones y configura tu bot — todo via API REST.

Autenticacion

Cada negocio tiene su propio token. Generalo en Dashboard → API Access.

Incluir en cada request: Authorization: Bearer <token>

GET /api/v1/status

Estado de conexion y configuracion del bot
# Example
curl -H "Authorization: Bearer YOUR_TOKEN" \
  https://boton.etthore.com/api/v1/status
// Response
{
  "business": "Mi Negocio",
  "connected": true,
  "phone": "5491138620812",
  "botPurpose": "attend",
  "botNewChats": false,
  "activeBotChats": 12,
  "untouchableChats": 2
}

GET /api/v1/chats

Lista de chats paginada
page
Pagina (desde 0)
pageSize
Cantidad por pagina (max 50, default 20)
curl -H "Authorization: Bearer YOUR_TOKEN" \
  https://boton.etthore.com/api/v1/chats?page=0&pageSize=20
// Response
{
  "chats": [
    {
      "jid": "5491112345678@s.whatsapp.net",
      "name": "Juan",
      "lastMessage": { "text": "hola", "direction": "incoming", "timestamp": "..." },
      "messageCount": 8,
      "botEnabled": true
    }
  ],
  "total": 45, "page": 0, "hasMore": true
}

GET /api/v1/chats/:jid/messages

Mensajes de un chat especifico
limit
Cantidad de mensajes (max 200, default 50)
curl -H "Authorization: Bearer YOUR_TOKEN" \
  https://boton.etthore.com/api/v1/chats/5491112345678@s.whatsapp.net/messages
// Response
{
  "jid": "5491112345678@s.whatsapp.net",
  "messages": [
    { "text": "hola", "direction": "incoming", "timestamp": "...", "botGenerated": false }
  ]
}

POST /api/v1/send

Envia mensaje a uno o varios numeros. Usa message para texto directo, o instruction para que el bot inicie la conversacion con una instruccion.
# Mensaje directo
curl -X POST -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"to":"5491112345678","message":"Hola, tu turno es manana a las 15hs"}' \
  https://boton.etthore.com/api/v1/send
# Enviar a varios + instruccion para el bot
curl -X POST -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"to":["5491112345678","5491198765432"],"instruction":"Ofrece turno para manana"}' \
  https://boton.etthore.com/api/v1/send
to
Numero o array de numeros (con codigo de pais, sin +)
message
Texto a enviar directamente
instruction
Instruccion para el bot — activa el bot en ese chat

POST /api/v1/config

Configura el asistente (todos los campos opcionales)
curl -X POST -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"botPurpose":"attend","botNewChats":true,"customInstructions":"Responde solo en espanol"}' \
  https://boton.etthore.com/api/v1/config
businessName
Nombre del negocio
businessDescription
Descripcion
botPurpose
attend | schedule | support | sell
guardrails
Reglas del bot
customInstructions
Instrucciones adicionales
botNewChats
Bot atiende chats nuevos automaticamente (true/false)
Webhook desde tu servidor: Usa POST /api/v1/send desde tu CRM, calendario, o cualquier sistema para enviar mensajes automaticamente. Por ejemplo, cuando un cliente agenda un turno, tu servidor puede llamar a BOTON para enviar la confirmacion por WhatsApp.