<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.7kas.com/index.php?action=history&amp;feed=atom&amp;title=TuCloudAPI_getqueuestats</id>
	<title>TuCloudAPI getqueuestats - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.7kas.com/index.php?action=history&amp;feed=atom&amp;title=TuCloudAPI_getqueuestats"/>
	<link rel="alternate" type="text/html" href="https://wiki.7kas.com/index.php?title=TuCloudAPI_getqueuestats&amp;action=history"/>
	<updated>2026-11-07T04:43:23Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.9</generator>
	<entry>
		<id>https://wiki.7kas.com/index.php?title=TuCloudAPI_getqueuestats&amp;diff=1257&amp;oldid=prev</id>
		<title>Maintenance script: TuCloudAPI reference (generated from func=help; call-center 2026-10-31)</title>
		<link rel="alternate" type="text/html" href="https://wiki.7kas.com/index.php?title=TuCloudAPI_getqueuestats&amp;diff=1257&amp;oldid=prev"/>
		<updated>2026-10-31T12:24:28Z</updated>

		<summary type="html">&lt;p&gt;TuCloudAPI reference (generated from func=help; call-center 2026-10-31)&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;#039;&amp;#039;TuCloudAPI function to manage FuturePBX (the cloud PBX). Available to: &amp;#039;&amp;#039;&amp;#039;SuperRoot, Operator, Client&amp;#039;&amp;#039;&amp;#039;.&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
{{Note|1=Requires the &amp;lt;code&amp;gt;pbx&amp;lt;/code&amp;gt; parameter (the PBX &amp;#039;&amp;#039;&amp;#039;name&amp;#039;&amp;#039;&amp;#039;, e.g. &amp;lt;code&amp;gt;tucall&amp;lt;/code&amp;gt;). The server verifies that your &amp;lt;code&amp;gt;ukey&amp;lt;/code&amp;gt;&amp;#039;s own account owns that PBX, whatever its role; otherwise, and also for a PBX that does not exist, it returns &amp;lt;code&amp;gt;{&amp;quot;ok&amp;quot;:false,&amp;quot;code&amp;quot;:&amp;quot;forbidden&amp;quot;}&amp;lt;/code&amp;gt;.}}&lt;br /&gt;
&lt;br /&gt;
== Description ==&lt;br /&gt;
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&amp;#039;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 &amp;lt; short_abandon), timeout, exitempty, exitkey, answered_in_sl (wait &amp;lt;= the queue&amp;#039;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-&amp;gt;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.&lt;br /&gt;
&lt;br /&gt;
== Call ==&lt;br /&gt;
 https://tucloudapi.7kas.com:9087/tucloud?func=getqueuestats&amp;amp;ukey=YOUR_KEY&amp;amp;pbx=PBX_NAME&lt;br /&gt;
GET, or POST with the parameters form-urlencoded in the body. Requires the &amp;lt;code&amp;gt;ukey&amp;lt;/code&amp;gt; parameter. Always HTTP 200; the response is a JSON envelope.&lt;br /&gt;
&lt;br /&gt;
== Parameters ==&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
! Parameter !! Type !! Required !! Default !! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;pbx&amp;lt;/code&amp;gt; || 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.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;from&amp;lt;/code&amp;gt; || string || Yes || — || First local day, YYYY-MM-DD.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;to&amp;lt;/code&amp;gt; || string || Yes || — || Last local day, YYYY-MM-DD (inclusive, &amp;gt;= from).&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;interval&amp;lt;/code&amp;gt; || string || Yes || — || Bucket of by_interval: hour | day | week.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;queue_id&amp;lt;/code&amp;gt; || integer || No || &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt; || One queue (_id of getqueues); 0 or absent = every queue of the PBX. not_found if not this PBX&amp;#039;s.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;short_abandon&amp;lt;/code&amp;gt; || integer || No || &amp;lt;code&amp;gt;5&amp;lt;/code&amp;gt; || Short-abandon threshold in seconds (0-600): an ABANDON with wait &amp;lt; it counts as short_abandoned (still inside abandoned) and leaves the SL base.&lt;br /&gt;
|}&lt;br /&gt;
== Example ==&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;https://tucloudapi.7kas.com:9087/tucloud?func=getqueuestats&amp;amp;ukey=KEY&amp;amp;pbx=tucall&amp;amp;from=2026-10-01&amp;amp;to=2026-10-31&amp;amp;interval=day&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Response ==&lt;br /&gt;
{ok, from, to, interval, queue_id, short_abandon, totals:K, by_interval:[{start:&amp;quot;YYYY-MM-DD HH:MM&amp;quot;, ...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}.&lt;br /&gt;
&lt;br /&gt;
== Errors ==&lt;br /&gt;
Always HTTP 200. On failure the body is &amp;lt;code&amp;gt;{&amp;quot;ok&amp;quot;:false,&amp;quot;code&amp;quot;:&amp;quot;...&amp;quot;,&amp;quot;message&amp;quot;:&amp;quot;...&amp;quot;}&amp;lt;/code&amp;gt;. Common codes: &amp;lt;code&amp;gt;missing_pbx&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;forbidden&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;invalid_param&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;not_found&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;conflict&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;in_use&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;db_error&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;server_busy&amp;lt;/code&amp;gt;; the Response section above lists any specific to this function.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
Back to [[TuCloudAPI]]&lt;br /&gt;
[[Category:TuCloudAPI SuperRoot]][[Category:TuCloudAPI Operator]][[Category:TuCloudAPI Client]][[Category:TuCloudAPI]]&lt;/div&gt;</summary>
		<author><name>Maintenance script</name></author>
	</entry>
</feed>