Skip to main content

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​

KeyValueRequired
Authorization<token>Yes
X-Requested-WithXMLHttpRequestYes
Content-Typeapplication/jsonYes

Parameters​

ParameterTypeRequiredDescription
fromDateNoStart date (YYYY-MM-DD)
toDateNoEnd date (YYYY-MM-DD)
widgetIdIntegerNoFilter by widget ID
timeZoneStringYesTime 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"
}
}