Jump to content

TuCloudAPI getqueuestats

From Wiki 7Kas

TuCloudAPI function to manage FuturePBX (the cloud PBX). Available to: SuperRoot, Operator, Client.

ℹ Requires the pbx parameter (the PBX name, e.g. tucall). The server verifies that your ukey's own account owns that PBX, whatever its role; otherwise, and also for a PBX that does not exist, it returns {"ok":false,"code":"forbidden"}.

Description

Call-center history from voip_queue_log (gabpbx contract v1, 2026-10-31): totals, per interval, per queue and per agent between two local days (Europe/Madrid, inclusive). Core app_queue events only: the engine module's duplicate ENTERQUEUE/EXITQUEUE/AGENT*/PAUSEAGENT rows are ignored, except EXITQUEUE FULL/JOINEMPTY = refused. K = offered (entered + refused), entered, refused_full, refused_joinempty, answered (CONNECT), abandoned (ABANDON, short ones included), short_abandoned (wait < short_abandon), timeout, exitempty, exitkey, answered_in_sl (wait <= the queue's servicelevel; a servicelevel of 0 yields 0 %), sl_pct = answered_in_sl / (offered - short_abandoned), asa, max_wait, avg_abandon_wait, avg_talk, talk_total, transfers, caller_hangups, agent_hangups, answer_rate_pct, abandon_rate_pct. A (per member name) = agent, name and exten of the extension, answered, ring_no_answer, ring_no_answer_avg_ms, talk_total, talk_avg, pause_total, pause_by_reason {reason: s}, session_total (ADDMEMBER->REMOVEMEMBER, roster loads excluded; null for static members), occupancy = talk / (session - pause) %. Integer seconds; percentages one decimal, null when the base is 0. Every bucket of the range is listed (zeros included; weeks start Monday). Limits: hour interval at most 31 days, any interval at most 366 days. READ-ONLY.

Call

https://tucloudapi.7kas.com:9087/tucloud?func=getqueuestats&ukey=YOUR_KEY&pbx=PBX_NAME

GET, or POST with the parameters form-urlencoded in the body. Requires the ukey parameter. Always HTTP 200; the response is a JSON envelope.

Parameters

Parameter Type Required Default Meaning
pbx string Yes — FuturePBX NAME (e.g. tucall). The (ukey, pbx) pair is the tenant boundary; the server verifies the ukey owns this PBX and scopes the report to it.
from string Yes — First local day, YYYY-MM-DD.
to string Yes — Last local day, YYYY-MM-DD (inclusive, >= from).
interval string Yes — day | week.
queue_id integer No 0 One queue (_id of getqueues); 0 or absent = every queue of the PBX. not_found if not this PBX's.
short_abandon integer No 5 Short-abandon threshold in seconds (0-600): an ABANDON with wait < it counts as short_abandoned (still inside abandoned) and leaves the SL base.

Example

https://tucloudapi.7kas.com:9087/tucloud?func=getqueuestats&ukey=KEY&pbx=tucall&from=2026-10-01&to=2026-10-31&interval=day

Response

{ok, from, to, interval, queue_id, short_abandon, totals:K, by_interval:[{start:"YYYY-MM-DD HH:MM", ...K}], by_queue:[{queue_id, title, exten, servicelevel, ...K}], by_agent:[{agent, name, exten, answered, ring_no_answer, ring_no_answer_avg_ms, talk_total, talk_avg, pause_total, pause_by_reason, session_total, occupancy}]}. K = {offered, entered, refused_full, refused_joinempty, answered, abandoned, short_abandoned, timeout, exitempty, exitkey, answered_in_sl, sl_pct, asa, max_wait, avg_abandon_wait, avg_talk, talk_total, transfers, caller_hangups, agent_hangups, answer_rate_pct, abandon_rate_pct}.

Errors

Always HTTP 200. On failure the body is {"ok":false,"code":"...","message":"..."}. Common codes: missing_pbx, forbidden, invalid_param, not_found, conflict, in_use, db_error, server_busy; the Response section above lists any specific to this function.


Back to TuCloudAPI