Group Users Call Statistics
Generates CSV file detailing all users in a single groups outgoing and incoming call statistics for a specified time range.
Data is only guaranteed for 3 months, if your requesting over 3 months all data may not be saved and output should be reviewed. This is an Odin limitation.
We have found that customers like to review how busy their users are and identify any that are not in use so they are lower their bill. This report identifies exactly that showing all users call statistics over a maximum guaranteed period of 3 months. If a user has not made a call in that time this can be easily spotted as the row will consist of only 0's (See example out below).
Example Output

Parameters
service_provider_id (str): Service Provider/ Enterprise where group is hosted.
group_id (str): Target Group you would like to know user statistics for.
start_date (str): Start date of desired time period. Date must follow format 'YYYY-MM-DD'
end_date (str, optional): End date of desired time period. Date must follow format 'YYYY-MM-DD'. If this date is the same as Start date you do not need this parameter. Defaults to None.
start_time (type, optional): Start time of desired time period. Time must follow formate 'HH:MM:SS'. If you do not need to filter by time and want the whole day leave this parameter. Defaults to "00:00:00". MAX Request is 3 months.
end_time (type, optional): End time of desired time period. Time must follow formate 'HH:MM:SS'. If you do not need to filter by time and want the whole day leave this parameter. Defaults to "23:59:59". MAX Request is 3 months.
time_zone (str, optional): A specified time you would like to see call records in.
Return
None: This will generate a CSV file with the report in the folder 'os_reports'. Check this folder once script has completed.
The script makes use of the following methods:
api.users.get_users()
api.reports.get_users_stats()
api.users.get_user_services()
How To Use:
# Whole day in date range
assistant.group_users_call_statistics(
service_provider_id="serviceProviderID",
group_id="groupID",
start_date="11-04-2024",
end_date="14-06-2024",
)
# Specific time during day and in EST timezone
assistant.group_users_call_statistics(
service_provider_id="serviceProviderID",
group_id="groupID",
start_date="11-04-2024",
end_date="14-06-2024",
start_time = "09:00:00",
end_time: str = "17:00:00",
time_zone: str = "EST"
)
Terminal Output
Start.
Fetching list of users in GroupID.
Fetching individual stats for each user. This may take several minutes.: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 90/90 [01:34<00:00, 1.04s/it]
Formatting individual stats for each user.: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 90/90 [00:00<00:00, 42144.40it/s]
End.
Last updated
Was this helpful?