Queue Reports JSON API


The Queue Reports JSON API provides an easily parse-able interface to your queue data.


The Freevoice JSON API is intended for software developers. To use it you should be familiar with web programming and be comfortable creating applications that consume web services through HTTP requests. 


Start by activating the API key under Queue Reports -> Configuration.

Using the API

Requests can be either POST or GET methods.
The request URL will be in the format:
http://youraccount.freevoicepbx.com/queue_api/?apikey={your_api_key}&function=queue_report&report=totals&start=09-01-2016&end=09-05-2016

All the JSON returned is in the form:

{
  "function":"queue_report",
  "report":"totals",
  "status":"OK",
  "queues":[
    {
      "queue_id":700,
      "queue_name":"Sales",
      "counts":{
        "total":17,
        "complete":13,
        "abandon":"1",
        "overflow":"3",
        "optout":0,
        "noagents":0
      }
    }
}


Report Functions

totals - Get the total calls by status for one or more queues
hold_times - Get the hold times for one or more queues
talk_times - Get the talk times for one or more queues
calls_by_did - Get the DID call counts for one or more queues
calls_by_hour - Get the calls per hour count for one or more queues
log - Get queue records 


totals

Example URL:
http://youraccount.freevoicepbx.com/queue_api/?apikey={your_api_key}&function=queue_report&report=totals&start=09-01-2016&end=09-05-2016
Parameters:
start = Date/time for start of search
end = Date/Time for end of search
queue_id = Queue id(s) to filter search. To enter multiple separate with a comma. Ex: 700,701
Example Response
{
  "function":"queue_report",
  "report":"totals",
  "status":"OK",
  "queues":[
    {
      "queue_id":700,
      "queue_name":"Sales",
      "counts":{
        "total":17,
        "complete":13,
        "abandon":"1",
        "overflow":"3",
        "optout":0,
        "noagents":0
      }
    }
}

hold_times

Example URL:

http://youraccount.freevoicepbx.com/queue_api/?apikey={your_api_key}&function=queue_report&report=hold_times&start=09-01-2016&end=09-05-2016

Parameters:
start = Date/time for start of search
end = Date/Time for end of search
queue_id = Queue id(s) to filter search. To enter multiple separate with a comma. Ex: 700,701
Example Response

{
  "function":"queue_report",
  "report":"hold_times",
  "status":"OK",
  "queues":[
    {
      "queue_id":700,
      "queue_name":"New Sales",
      "counts":{
        "avg_hold":"6",
        "max_hold":"17"
      }
    }
}

talk_times

Example URL:
http://youraccount.freevoicepbx.com/queue_api/?apikey={your_api_key}&function=queue_report&report=talk_times&start=09-01-2016&end=09-05-2016

Parameters:
start = Date/time for start of search
end = Date/Time for end of search
queue_id = Queue id(s) to filter search. To enter multiple separate with a comma. Ex: 700,701
Example Response

{
  "function":"queue_report",
  "report":"talk_times",
  "status":"OK",
  "queues":[
    {
      "queue_id":700,
      "queue_name":"New Sales",
      "counts":{
        "avg_talk":"481",
        "max_talk":"1258"
      }
    }
}

calls_by_did

Example URL:

http://youraccount.freevoicepbx.com/queue_api/?apikey={your_api_key}&function=queue_report&report=talk_times&start=09-01-2016&end=09-05-2016

Parameters:
start = Date/time for start of search
end = Date/Time for end of search
queue_id = Queue id(s) to filter search. To enter multiple separate with a comma. Ex: 700,701
Example Response

{
  "function":"queue_report",
  "report":"calls_by_did",
  "status":"OK",
  "queues":[
    {
      "queue_id":700,
      "queue_name":"Sales",
      "counts":{
        "8443306970":"1",
        "8774572711":"1",
        "8885180916":"1"
      }
    }
}

calls_by_hour

Example URL:
http://youraccount.freevoicepbx.com/queue_api/?apikey={your_api_key}&function=queue_report&report=calls_by_hour&start=09-01-2016&end=09-05-2016

Parameters:

start = Date/time for start of search
end = Date/Time for end of search
queue_id = Queue id(s) to filter search. To enter multiple separate with a comma. Ex: 700,701
Example Response

{
  "function":"queue_report",
  "report":"calls_by_hour",
  "status":"OK",
  "queues":[
    {
      "queue_id":"702",
      "queue_name":"Support",
      "counts":[
        "702 Support",
        {
          "00:00":0
        },
        {
          "01:00":0
        },
        {
          "02:00":0
        },
        {
          "03:00":"1"
        },
        {
          "04:00":"1"
        },
        {
          "05:00":0
        },
        {
          "06:00":"87"
        },
        {
          "07:00":"130"
        },
        {
          "08:00":"226"
        },
        {
          "09:00":"361"
        },
        {
          "10:00":"261"
        },
        {
          "11:00":"362"
        },
        {
          "12:00":"268"
        },
        {
          "13:00":"182"
        },
        {
          "14:00":"202"
        },
        {
          "15:00":"174"
        },
        {
          "16:00":"131"
        },
        {
          "17:00":"97"
        },
        {
          "18:00":"5"
        },
        {
          "19:00":"1"
        },
        {
          "20:00":"2"
        },
        {
          "21:00":0
        },
        {
          "22:00":"2"
        },
        {
          "23:00":"2"
        }
      ]
    }
  ]
}

log

Example URL:

http://youraccount.freevoicepbx.com/queue_api/?apikey={your_api_key}&function=queue_report&report=log&start=09-01-2016&end=09-05-2016

Parameters:

start = Date/time for start of search
end = Date/Time for end of search
queue_id = Queue id(s) to filter search. To enter multiple separate with a comma. Ex: 700,701
cid_number = Caller ID number to filter on
cid_name = Caller ID name to filter on
Example Response

{
  "function":"queue_report",
  "report":"log",
  "status":"OK",
  "records":[
    {
      "id":"10229",
      "cid_number":"7147961716",
      "cid_name":"Support:7147961716",
      "did":"7147833001",
      "status":"ABANDON",
      "entered":"2017-09-14 06:53:16",
      "answered":null,
      "queue":"702 Support",
      "agent":"",
      "position":"1",
      "originalposition":"1",
      "holdtime":"178",
      "keypressed":"0",
      "callduration":"0",
      "url":"",
      "disposition":"",
      "recordedfile":"q702-20170914-065316-1505397162.258660.wav",
      "xferto":null,
      "xferfrom":null,
      "type":"queue"
    }
}