Skip to main content

get_stats

GET /stats

Get your statics key values

require 'rest-client'

RestClient::Request.execute method: :get,
url: 'https://api.diduenjoy.com/api/v1/stats',
user: 'PUT-YOUR-API-KEY-HERE'

# example with filters

RestClient::Request.execute method: :get,
url: 'https://api.diduenjoy.com/api/v1/stats?filter[surveys][0]=Paris%20Boutique&filter[segments][city][0]=paris&filter[start_date]=Fri%20Oct%2011%202019%2002:00:00%20GMT+0200%20(Central%20European%20Summer%20Time)',
user: 'PUT-YOUR-API-KEY-HERE'

# => {
# "total": 74,
# "score": 6.594594594594595,
# "promoter_count": 31,
# "passiv_count": 17,
# "detractor_count": 26,
# "nps": 7,
# "sent": 120
#}

attributes

attributedescription
total
integer
total number of found feedbacks
score
float
average score
promoter_count
integer
number of promoter profiles
passiv_count
integer
number of passiv profiles
detractor_count
integer
number of detractor profiles
nps
integer
net promoter score, integer varying from -100 to +100 depending on the number of promoters and detractors
sent
integer
number of sent surveys

optional parameters "filters"

parameterdescription
surveys
array
filter over feedback of the indicated surveys
segments
array
associative array of segments, where segments names are the keys and the values are the. To filter over feedbacks having the specified segments name with the corresponding values
start_date
date
filter on feedback answered after the specified date
end_date
date
filter on feedback answered before the specified date
with_follow_ups
boolean
include feedbacks with follow-up feedbacks