I was able to call Ring Central Analytics API for the user performance, such as missed calls, aggregated by user by a fixed date range, for example, from 2022-03-23 to 2022-03-24. How can I get the API response by user by a dynamic date range, for example, yesterday, given today is 2022-03-25. My ultimate goal is to have the API response daily as below. I also posted my script below for your reference.
# desired table (after parsed api json into tabular format)
date | user | missed_call_count |
2022-03-23 | user_1 | 10 |
2022-03-23 | user_2 | 20 |
2022-03-24 | user_1 | 30 |
# script
{
"grouping": {
"groupBy": "Users",
"ids": []
},
"timeSettings": {
"timeRange": {
"timeFrom": "2022-03-23T00:00:00.000Z",
"timeTo": "2022-03-24T00:00:00.000Z"
},
"advancedTimeSettings": {
"timeZone": "US/Eastern",
"includeDays": [
"Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"
],
"includeHours": [
{
"from": "00:00",
"to": "23:59"
}
]
}
},
"responseOptions": {
"counters": {
"allCalls": {
"aggregationType": "Sum"
},
"timers": {
"allCallsDuration": {
"aggregationType": "Sum"
}
}
}
}
}