Files
hackathon-biocode-17bf223ba…/API_CONTRACT.md
2026-05-22 17:43:04 -06:00

33 lines
864 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Notification Service — Contrato de API
Base URL: http://localhost:8001
## Para P1 (Backend)
### Avisar que el camión avanzó
POST /internal/position-update
Body: { "routeId": "RUTA-01", "positionId": 2 }
Respuesta: { "status": "ok", "routeId": "RUTA-01", "positionId": 2 }
## Para P3 (App Android)
### Registrar token FCM del usuario
POST /fcm-token
Body: { "colonia": "Zona Centro", "token": "TOKEN_FCM_DEL_CELULAR" }
Respuesta: { "status": "ok" }
### Consultar ETA de la ruta del usuario
GET /eta/RUTA-01
Respuesta:
{
"routeId": "RUTA-01",
"positionId": 3,
"eta_window": "06:38 07:00",
"message": "El camión llegará a tu zona entre las 06:38 y 07:00",
"minutes_approx": 13
}
## Para el demo
### Reiniciar todas las rutas
POST /internal/reset
### Forzar trigger en vivo
POST /internal/demo
Body: { "routeId": "RUTA-01", "positionId": 4 }