How can we help you?

REST Sample Requests
Posted by: Nicolás Gudiño Posted on: May-16th, 2016 20:45

REST API

This is a quick run down on things you can try in browser directly via the REST interface. Results are returned in JSON format.

Realtime

To see realtime snapshot/information for queue stats and agent stats:

http://server/stats/rest/index.php?entity=realtime

To see the same realtime information but limited to one or more queues instead of all:

http://server/stats/rest/index.php?entity=realtime&queues=100,101


Available Queues

To retrieve the list of queues available on the system/reports:

http://server/stats/rest/index.php?entity=queues

To see a particular queue you can filter out by id:

http://server/stats/rest/index.php?entity=queues/1


Available Agents

To see the list of available Agents on the system/reports:

http://server/stats/rest/index.php?entity=agents

You can select only one particular agent by id:

http://server/stats/rest/index.php?entity=agents/1

Call Flow

It is possible to retrieve all events concerning one particular call by knowing the call uniqueid:

http://server/stats/rest/index.php?entity=call/1429548401.6096


Search

It is possible to search for calls. You can narrow down results by filtering by:

  • start = start date
  • end = end date
  • secondsstart = start second on the day ( minimum value 0 )
  • secondsend = end seconds for the day ( maximum value 86400 )
  • agent = agent
  • queue = queue
  • duration = duration in seconds
  • dur_condition = condition comparison for duration , like > or < or =

So, if you want to search for a call with callerid 4126412320 on January 1st 2015, that lasted for more than 60 seconds, you can use this:

http://server/stats/rest/index.php?entity=search&clid=4126412320&start=2015-01-01&end=2015-01-01&duration=60&dur_condition=>

Available Reports

To see a list of available reports:

http://server/stats/rest/index.php?entity=reports

To run a particular report and get the data:

http://server/stats/rest/index.php?entity=reports/answered_calls_detail&start=2016-01-01&end=2016-01-31

You can use these fields:
  • start = start date
  • end = end date
  • secondsstart = start second on the day ( minimum value 0 )
  • secondsend = end seconds for the day ( maximum value 86400 )

Leave a comment