API documentation

Getting metrics

Retrieve metrics for your account (includes your Net Promoter Score and response breakdown).

Endpoint

GET /v1/metrics.json

Example request

curl https://api.delighted.com/v1/metrics.json \
  -u YOUR_DELIGHTED_API_KEY:
Delighted::Metrics.retrieve
delighted.metrics.retrieve(); // returns a promise
delighted.Metrics.retrieve()
\Delighted\Metrics::retrieve();

Example response

{
  "nps": 51,
  "promoter_count": 32,
  "promoter_percent": 63,
  "passive_count": 13,
  "passive_percent": 25,
  "detractor_count": 6,
  "detractor_percent": 12,
  "response_count": 51
}

Parameters

Name Type Description
since Integer An optional Unix timestamp to restrict metrics to those created on or after this time. Formatting example (for 1 hour ago): 1544436936.
until Integer An optional Unix timestamp to restrict metrics to those created on or before this time. Formatting example (for the current time): 1544440536.
trend String An optional ID of a trend to restrict metrics to that trend. To obtain the ID for a trend, visit the trends page. For example, if the URL for the desired trend ends with /trends/1234 the ID of that trend is 1234. Note: this parameter does not apply to the email metrics group.
groups Array An optional array specifying the metric groups you want returned. To obtain core metrics (Net Promoter Score and response counts), pass groups[]=core. To obtain email metrics (sent, open, bounce counts, etc.), pass groups[]=email. To obtain core and email metrics, pass groups[]=core&groups[]=email. The default is groups[]=core.