API · Eventos
Recepción, apertura, clics y permisos reportados por la app.
Base: https://api.pushhub.daertec.com. Todas las respuestas usan { errCode, errMsg, data, meta }. Autenticación y llaves · Catálogo de errores
POST/v1/events
Reportar eventos de la app (pk_ o sk_ con events:write; CORS abierto). Responde 202.
Llave: pk_ / sk_
Un evento ({type, token, ...}) o un lote en events (maximo 100). Tipos: received, opened, clicked (actionId opcional = id del boton),
dismissed (requieren notificationId = _phid del payload) y permission_granted / permission_denied (actualizan notificationsEnabled).
occurredAt opcional (ISO 8601 o epoch; hasta 7 dias atras). Cada evento se valida: el dispositivo debe existir en la app y la
notificacion debe haberle sido entregada. Los repetidos (mismo dispositivo, notificacion, tipo y boton; o el mismo estado de permiso)
se descartan. Limite adicional de 60 eventos por minuto por dispositivo. Se escriben en segundo plano en pocos segundos.
Motivos de rechazo por evento: invalid_type, token_required, rate_limited, device_not_found, notification_required,
notification_not_found, not_a_recipient, invalid_action, invalid_occurred_at, occurred_at_out_of_range.
Parámetros
| Nombre | En | Tipo | Descripción |
|---|---|---|---|
appId | query | string | Si la llave no esta limitada a una app (tambien en el cuerpo) |
Cuerpo
| Campo | Tipo | Descripción |
|---|
Respuestas: 202422
curl -X POST "https://api.pushhub.daertec.com/v1/events" \
-H "Authorization: Bearer pk_test_TU_LLAVE_PUBLICA" \
-H "Content-Type: application/json" \
-d '{
"type": "opened",
"token": "TOKEN_DEL_DISPOSITIVO",
"notificationId": "01JC2Y3Z4X5W6V7U8T9S0R1Q2P"
}'