Discussions

Ask a Question
Back to All

No possibility to retrieve the statistics contained between today's date and days_ago_end

POST https://dialpad.com/api/v2/stats
{
"days_ago_end": 1,
"days_ago_start": 0,
"timezone": "UTC",
"coaching_group": true,
"coaching_team": true,
"export_type": "records",
"group_by": "user",
"is_today": false,
"stat_type": "calls"
}

"days_ago_start" = 0 to retrieve data of current date
and "days_ago_end" = 1 to retrieve yesterday's data.

But that only gives me yesterday's date.


So we are forced to execute 2 queries in a row, what makes the query slow :
// retrieve yesterday'data
POST https://dialpad.com/api/v2/stats
{
"days_ago_end": 1,
"days_ago_start": 1,
"timezone": "UTC",
"coaching_group": true,
"coaching_team": true,
"export_type": "records",
"group_by": "user",
"is_today": false,
"stat_type": "calls"
}

followed by
// retrieve today'data
POST https://dialpad.com/api/v2/stats
{
"timezone": "UTC",
"coaching_group": true,
"coaching_team": true,
"export_type": "records",
"group_by": "user",
"is_today": true,
"stat_type": "calls"
}