> For a complete documentation index, fetch https://docs.voximplant.ai/llms.txt # GetSmartQueueRealtimeMetrics POST https://api.voximplant.com/platform_api/GetSmartQueueRealtimeMetrics Gets the metrics for the specified SmartQueue for the last 30 minutes. Refer to the SmartQueue reporting guide to learn more. **Example request:** Get the time agents spent in the DIALING status for all SmartQueues within one application. Reference: https://docs.voximplant.ai/api-reference/management-api/reference/smartqueue/get-smart-queue-realtime-metrics ## Authentication - `Authorization` header (bearer token, required) — Voximplant Management API uses signed JWT tokens generated from your service-account private key. Pass the token in the `Authorization` header as a Bearer value: ``` Authorization: Bearer $VOXIMPLANT_TOKEN ``` See [Authorization](/api-reference/management-api/authorization) for ready-to-copy snippets in bash, Python, Node.js and Go that turn your `credentials.json` into a token. ## Request ### Query parameters - `application_id` (integer, optional) — The application ID to search by. **Required** unless **application_name** is provided. - `application_name` (string, optional) — The application name to search by. **Required** unless **application_id** is provided. - `user_id` (list of integer, optional) — The user ID list with a maximum of 5 values separated by semicolons (;). Use the 'all' value to select all users. Can operate as a filter for the **occupancy_rate**, **sum_agents_online_time**, **sum_agents_ready_time**, **sum_agents_dialing_time**, **sum_agents_in_service_time**, **sum_agents_afterservice_time**, **sum_agents_dnd_time**, **sum_agents_banned_time**, **min_handle_time**, **max_handle_time**, **average_handle_time**, **count_handled_calls**, **min_after_call_worktime**, **max_after_call_worktime**, **average_after_call_worktime** report types - `user_name` (list of string, optional) — The user name list separated by semicolons (;). **user_name** can be used instead of **user_id** - `sq_queue_name` (list of string, optional) — The SmartQueue name list separated by semicolons (;). Can be used instead of **sq_queue_id** - `from_date` (string, optional) — The from date in the selected timezone in 24-h format: YYYY-MM-DD HH:mm:ss. Default is the current time minus 30 minutes - `to_date` (string, optional) — The to date in the selected timezone in 24-h format: YYYY-MM-DD HH:mm:ss. Default is the current time - `timezone` (string, optional, default: UTC) — The selected timezone or the 'auto' value (the account location) - `interval` (string, optional, default: 0-0-0 0:30:0) — Interval format: YYYY-MM-DD HH:mm:ss. Default is 30 minutes - `report_type` (list of string, required) — The report type. Possible values are: calls_blocked_percentage, count_blocked_calls, im_blocked_chats_percentage, im_count_blocked_chats, im_answered_chats_rate, average_abandonment_rate, count_abandonment_calls, service_level, im_service_level, occupancy_rate, im_agent_occupancy_rate, agent_utilization_rate, im_agent_utilization_rate, sum_agents_online_time, sum_agents_ready_time, sum_agents_dialing_time, sum_agents_in_service_time, sum_agents_in_service_incoming_time, sum_agents_in_service_outcoming_time, sum_agents_afterservice_time, sum_agents_dnd_time, sum_agents_custom_1_time, sum_agents_custom_2_time, sum_agents_custom_3_time, sum_agents_custom_4_time, sum_agents_custom_5_time, sum_agents_custom_6_time, sum_agents_custom_7_time, sum_agents_custom_8_time, sum_agents_custom_9_time, sum_agents_custom_10_time, sum_agents_banned_time, im_sum_agents_online_time, im_sum_agents_ready_time, im_sum_agents_in_service_time, im_sum_agents_dnd_time, im_sum_agents_custom_1_time, im_sum_agents_custom_2_time, im_sum_agents_custom_3_time, im_sum_agents_custom_4_time, im_sum_agents_custom_5_time, im_sum_agents_custom_6_time, im_sum_agents_custom_7_time, im_sum_agents_custom_8_time, im_sum_agents_custom_9_time, im_sum_agents_custom_10_time, im_sum_agents_banned_time, average_agents_idle_time, max_agents_idle_time, min_agents_idle_time, percentile_0_25_agents_idle_time, percentile_0_50_agents_idle_time, percentile_0_75_agents_idle_time, min_time_in_queue, max_time_in_queue, average_time_in_queue, min_answer_speed, max_answer_speed, average_answer_speed, im_min_answer_speed, im_max_answer_speed, im_average_answer_speed, min_handle_time, max_handle_time, average_handle_time, count_handled_calls, min_after_call_worktime, max_after_call_worktime, average_after_call_worktime, count_agent_unanswered_calls, im_count_agent_unanswered_chats, min_reaction_time, max_reaction_time, average_reaction_time, im_min_reaction_time, im_max_reaction_time, im_average_reaction_time, im_count_abandonment_chats, im_count_lost_chats, im_lost_chats_rate, call_count_assigned_to_queue, im_count_assigned_to_queue - `group_by` (string, optional) — Group the result by **agent** or *queue*. The **agent** grouping is allowed for 1 queue and for the occupancy_rate, sum_agents_online_time, sum_agents_ready_time, sum_agents_dialing_time, sum_agents_in_service_time, sum_agents_afterservice_time, sum_agents_dnd_time, sum_agents_banned_time, min_handle_time, max_handle_time, average_handle_time, count_handled_calls, min_after_call_worktime, max_after_call_worktime, average_after_call_worktime report types. The **queue** grouping allowed for the calls_blocked_percentage, count_blocked_calls, average_abandonment_rate, count_abandonment_calls, service_level, occupancy_rate, min_time_in_queue, max_time_in_queue, average_time_in_queue, min_answer_speed, max_answer_speed, average_answer_speed, min_handle_time, max_handle_time, average_handle_time, count_handled_calls, min_after_call_worktime, max_after_call_worktime, average_after_call_worktime report types - `max_waiting_sec` (integer, optional) — Maximum waiting time. Required for the **service_level** report type ## Response ### 200 Successful response - `result` (list of SmartQueueMetricsResult, optional) - `timezone` (string, optional) — The used timezone, e.g., 'Etc/GMT' ## Types ### SmartQueueMetricsResult The [GetSmartQueueRealtimeMetrics] function result. - `report_type` (string, optional) — The report type(s). Possible values are calls_blocked_percentage, count_blocked_calls, average_abandonment_rate, count_abandonment_calls, service_level, occupancy_rate, sum_agents_online_time, sum_agents_ready_time, sum_agents_dialing_time, sum_agents_in_service_time, sum_agents_afterservice_time, sum_agents_dnd_time, sum_agents_banned_time, min_time_in_queue,max_time_in_queue, average_time_in_queue, min_answer_speed, max_answer_speed, average_answer_speed, min_handle_time, max_handle_time, average_handle_time, count_handled_calls, min_after_call_worktime, max_after_call_worktime, average_after_call_worktime, sum_agents_custom_1_time ... sum_agents_custom_10_time, call_count_assigned_to_queue, im_count_assigned_to_queue - `groups` (list of SmartQueueMetricsGroups, optional) — Grouping by agent or queue ### SmartQueueMetricsGroups The [SmartQueueMetricsResult] details. - `sq_queue_id` (integer, optional) — The SmartQueue ID - `sq_queue_name` (string, optional) — The SmartQueue name - `user_id` (integer, optional) — The user ID - `user_name` (string, optional) — The user name - `user_display_name` (string, optional) — The user display name - `values` (list of SmartQueueMetricsGroupsValues, optional) — The group values ### SmartQueueMetricsGroupsValues The [SmartQueueMetricsGroups] details. - `from_date` (string, optional) — Timestamp in YYYY-MM-DD HH:mm:ss format. The start of the period - `to_date` (string, optional) — Timestamp in YYYY-MM-DD HH:mm:ss format. The end of the period - `value` (integer, optional) — The report value ## Examples **Response** ```json { "result": [ { "report_type": "sum_agents_dialing_time", "groups": [ { "values": [ { "from_date": "2021-05-25 11:12:44", "to_date": "2021-05-25 11:42:44", "value": 32 } ] } ] } ], "timezone": "Etc/GMT" } ``` **SDK Code** ```python Dialing status statistics import requests url = "https://api.voximplant.com/platform_api/GetSmartQueueRealtimeMetrics" querystring = {"report_type":"[\"string\"]"} headers = {"Authorization": "Bearer "} response = requests.post(url, headers=headers, params=querystring) print(response.json()) ``` ```javascript Dialing status statistics const url = 'https://api.voximplant.com/platform_api/GetSmartQueueRealtimeMetrics?report_type=%5B%22string%22%5D'; const options = {method: 'POST', headers: {Authorization: 'Bearer '}}; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go Dialing status statistics package main import ( "fmt" "net/http" "io" ) func main() { url := "https://api.voximplant.com/platform_api/GetSmartQueueRealtimeMetrics?report_type=%5B%22string%22%5D" req, _ := http.NewRequest("POST", url, nil) req.Header.Add("Authorization", "Bearer ") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby Dialing status statistics require 'uri' require 'net/http' url = URI("https://api.voximplant.com/platform_api/GetSmartQueueRealtimeMetrics?report_type=%5B%22string%22%5D") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) request["Authorization"] = 'Bearer ' response = http.request(request) puts response.read_body ``` ```java Dialing status statistics import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.post("https://api.voximplant.com/platform_api/GetSmartQueueRealtimeMetrics?report_type=%5B%22string%22%5D") .header("Authorization", "Bearer ") .asString(); ``` ```php Dialing status statistics request('POST', 'https://api.voximplant.com/platform_api/GetSmartQueueRealtimeMetrics?report_type=%5B%22string%22%5D', [ 'headers' => [ 'Authorization' => 'Bearer ', ], ]); echo $response->getBody(); ``` ```csharp Dialing status statistics using RestSharp; var client = new RestClient("https://api.voximplant.com/platform_api/GetSmartQueueRealtimeMetrics?report_type=%5B%22string%22%5D"); var request = new RestRequest(Method.POST); request.AddHeader("Authorization", "Bearer "); IRestResponse response = client.Execute(request); ``` ```swift Dialing status statistics import Foundation let headers = ["Authorization": "Bearer "] let request = NSMutableURLRequest(url: NSURL(string: "https://api.voximplant.com/platform_api/GetSmartQueueRealtimeMetrics?report_type=%5B%22string%22%5D")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "POST" request.allHTTPHeaderFields = headers let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ```