Skip to main content

Ratings per interval

Access aggregate statistics about ratings per interval (i.e per day) by executing:

query RatingsInterval(
$deskIds: _uuid
$brainIds: _uuid
$integrationIds: _uuid
$brainVersions: _int4
$startDate: timestamp
$endDate: timestamp
$intervalInDays: interval
$agentIds: _text
$isTest: Boolean
) {
rows: ratings_interval_counts(
args: {
start_time: $startDate
end_time: $endDate
interval_span: $intervalInDays
brain_parent_ids: $brainIds
desk_ids: $deskIds
integration_ids: $integrationIds
brain_versions: $brainVersions
is_test: $isTest
agent_ids: $agentIds
}
) {
date: per_interval
avg_rating
median_rating
num_more_than_3
num_ratings
}
}

Below are some examples of how RatingsInterval can be called.

{
"deskIds": "{d2be0283-9b53-4d7b-b77d-2650f3a1a99c}",
"startDate": "2022-04-08",
"endDate": "2022-04-17",
"intervalInDays": "1 day"
}

Example Result:

{
"data": {
"rows": [
{
"date": "2022-04-16T00:00:00",
"avg_rating": 3.5,
"median_rating": 3,
"num_more_than_3": 130,
"num_ratings": 140
}
{
"date": "2022-04-17T00:00:00",
"avg_rating": 4.2,
"median_rating": 3,
"num_more_than_3": 100,
"num_ratings": 132
}
{
"date": "2022-04-18T00:00:00",
"avg_rating": 4.99,
"median_rating": 4.99,
"num_more_than_3": 98,
"num_ratings": 99
}
]
}
}