NPS Metrics
GET {api-domain}/api/ocular/admin/nps-summary
Endpoint to retrieve NPS (Net Promoter Score) metrics for widgets, including promoter, passive and detractor calculations.
Authentication
- Headers
| Key | Value | Required |
|---|---|---|
Authorization | <token> | Yes |
X-Requested-With | XMLHttpRequest | Yes |
Content-Type | application/json | Yes |
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
from | Date | No | Start date (YYYY-MM-DD) |
to | Date | No | End date (YYYY-MM-DD) |
widgetId | Integer | No | Filter by widget ID |
timeZone | String | Yes | Time zone (e.g. 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'
Successful Response
{
{
"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"
}
}