JSON API » queues » queues/destinations/statistics/get

Gets call statistics for queue destinations. This can be a single destination, or all destinations in a queue.

Input parameters

Requires authentication and the user role privilege.

NameTypeDescriptionRequiredDefault value
auth_usernameStringAuthentication username.Yes
auth_passwordStringAuthentication password.Yes
destinationIntegerID of destination to get statistics for.Yes, unless queue is specified.All in queue.
queueIntegerID of queue to get statistics for.Yes, unless destination is specified.Queue of destination.
startIntegerStart Unix timestamp.Recommended0
endIntegerEnd Unix timestamp.RecommendedNow.

Specify destination or queue, but not both. Failure to specify the start and end may put a heavy load on the database.

Responses

CodeDescription
200Success.
400Invalid input parameters specified. Check the key and message fields for more details.
401The authentication details provided are invalid.
402Your role does not allow this.
404The queue does not exist, or you do not have permission to view it.

Data returned

Fields of statistics. If all destinations in a queue were requested, this will be an array group by dtype and dnumber.

Example: With destination

http://enswitch.example.com/api/json/queues/destinations/statistics/get/?auth_username=user;auth_password=password;destination=123;start=1230000000;end=1240000000

{ "responses":[ { "code":"200", "key":"", "message":"OK" } ], "data":{ "calls":10, "talktime_sum":120, ... } }

Example: With queue

http://enswitch.example.com/api/json/queues/destinations/statistics/get/?auth_username=user;auth_password=password;queue=123;start=1230000000;end=1240000000

{ "responses":[ { "code":"200", "key":"", "message":"OK" } ], "data":[ { "dtype":"phone", "dnumber":"1234567", "calls":10, ... }, { "dtype":"phone", "dnumber":"1234568", "calls":11, ... } ] }

Change history

VersionChanges
3.13Function added.