Métricas NPS
GET {api-domain}/api/ocular/admin/nps-summary
Endpoint para obtener métricas NPS (Net Promoter Score) de widgets, incluyendo cálculos de promotores, pasivos y detractores.
Autenticación
- Headers
| Key | Value | Requerido |
|---|---|---|
Authorization | <token> | Sí |
X-Requested-With | XMLHttpRequest | Sí |
Content-Type | application/json | Sí |
Parámetros
| Parámetro | Tipo | Requerido | Descripción |
|---|---|---|---|
from | Date | No | Fecha de inicio (YYYY-MM-DD) |
to | Date | No | Fecha de fin (YYYY-MM-DD) |
widgetId | Integer | No | Filtrar por ID de widget |
timeZone | String | Sí | Zona horaria (ej. America/Santiago) |
Example Request
curl
curl --location -g '{{ocular-api-domain}}/api/ocular/admin/nps-summary?timeZone=America/Caracas&widgetId=1' \
--header 'Authorization: <token>'
--header 'X-Requested-With: XMLHttpRequest'
Respuesta Exitosa
{
{
"total": 14,
"totalRated": 2,
"totalRatedPercent": 14.29,
"commentRate": 0,
"commentRatePercent": 0,
"promoter": 0,
"promoterPercent": 0,
"passive": 0,
"passivePercent": 0,
"detractor": 2,
"detractorPercent": 100,
"nps": -100,
"widgetId": 1,
"widgetName": "Widget Ocular"
}
}