Integraciones con otras herramientas
Shlink tiene una API REST completa que puedes integrar con cualquier herramienta.
Integracion con n8n
Si tienes n8n desplegado, puedes automatizar la creacion de enlaces cortos.
Crear enlaces automaticamente
- En n8n, agrega un nodo HTTP Request
- Configura:
- Metodo:
POST - URL:
https://tu-shlink.deployalo.com/rest/v3/short-urls - Headers:
X-Api-Key: TU_API_KEY - Body: JSON con
longUrl
- Metodo:
Ejemplo: Acortar URLs de nuevos posts
Trigger: Nuevo post en WordPress
↓
HTTP Request: Crear short URL en Shlink
↓
Slack: Notificar con el enlace corto
Integracion con Zapier/Make
Crear Zap
- Trigger: El evento que quieras (nuevo lead, nuevo post, etc.)
- Action: Webhooks by Zapier > POST
- Configura la URL y API Key de Shlink
API Endpoints utiles
Crear enlace
POST /rest/v3/short-urls
{
"longUrl": "https://...",
"customSlug": "mi-slug",
"tags": ["marketing"]
}
Listar enlaces
GET /rest/v3/short-urls?page=1&itemsPerPage=20
Estadisticas de un enlace
GET /rest/v3/short-urls/{shortCode}/visits
Eliminar enlace
DELETE /rest/v3/short-urls/{shortCode}
Webhooks (Notificaciones)
Shlink puede notificarte cuando alguien hace clic en un enlace.
Configurar webhook
Agrega a tus variables de entorno:
VISITS_WEBHOOKS=https://tu-webhook.com/shlink
Shlink enviara un POST con:
{
"shortUrl": {
"shortCode": "abc123",
"longUrl": "https://..."
},
"visit": {
"referer": "https://twitter.com",
"userAgent": "...",
"visitLocation": {
"countryCode": "MX"
}
}
}
Casos de uso
Marketing
- Crea enlaces para cada campana con tags
- Usa el mismo slug en todas las plataformas
- Compara estadisticas por tag
Impresiones (offline)
- Genera QR codes para flyers/carteles
- Rastrea cuantas personas escanean
- Cambia el destino sin reimprimir
Afiliados
- Crea enlaces por producto/partner
- Rastrea conversiones con tags
- Comparte reportes con partners
Redes sociales
- Acorta URLs para bio de Instagram
- Rastrea clics por plataforma
- Cambia destino segun campanas