1. Telebroad | Support Center
  2. Solution home
  3. Legacy API Documentation
  4. REST API - GET Requests
Open navigation

GET/call/flow (Legacy)


  Articles in this support section discuss Telebroad's legacy APIs. To learn about the current version of Telebroad APIs, which offer additional authentication options and support for advanced features, please go to https://developers.telebroad.com/.



The GET/call/flow request returns a list of call legs in the flow sequence as a call is routed through the phone system.


The concept of a flow is easy to illustrate with an example:


Leg #1 - from the source number to the IVR (the phone audio menu).

Leg #2 - from the IVR to a queue.


Leg #3 - from the queue to an agent.


Leg #4 - from the agent to an extension of another agent.


Response Fields

The response has the following fields of information for each leg:


  • stype - the type of device/leg-component for the source number in the particular sequence of the flow. For example "external" number, "ivr", "queue", "phone", etc.

  • snumber - the source phone number in the particular sequence of the flow. 
  • callername_external - the name for the source caller in the particular sequence of the flow. 
  • dtype - the type of device/leg-component for the destination number in the particular sequence of the flow. For example "external" number, "ivr", "queue", "phone", etc.

    Note how the dtype becomes the new stype in each consecutive leg.

  • dnumber - the destination phone number in the particular sequence of the flow. 
  • start - the time when the lef the flow started, given in Unix time format.
  • totaltime - the total duration of the leg including any hold time and actual talk time, given in seconds.
  • talktime -  the total duration of talk time for the leg, given in seconds.
  • uniqueid - a unique ID given to the leg. 
  • status - the eventual status of the call , either "answer", "hangup" (by the recipient), or "cancel" (by the caller.)
  • recording - a path for an audio recording of the leg, if one was performed.
  • calluid - unique ID given to the call in the sense that each leg is also considered a separate call. This can be further explained by IDs being derived from the start time of a call and of course each segment starts on a different time.

Parameters


All parameters go in the header.


ParameterTypeOperation
callidstringThe ID for the call for which for the flow sequence is requested.

You obtain this ID using the GET/call/history request, where it looks like this -

"callid":"1526062490.371076"
limitintegerSpecify the number of messages to be returned by the request.
offsetintegerSpecify the first message to display. For example an offset of 3 will start the list on the 3rd message. If left empty the default will be the first record.

Example


To get the details of a flow sequence for a call use this syntax:


HTTPS method: GET


webserv.telebroad.com/api/teleconsole/rest/call/flow?callid=1524800377.1223783


Response:


Note the call flow as it moves from stype to dtype on the various legs – phone>ivr>queue>phone (another phone line.)


{error": null,
 "result":[
 {
 stype": "phone",
 "snumber": "1113848",
 "callername_external": "Melanie Fisher",
 "dtype": "ivr",
 "dnumber": "6208",
 "start": "1474440979",
 "totaltime": "846",
 "talktime": "846",
 "uniqueid": "1474440978.934821-2-24710-internal",
 "status": "answer",
        "recording": 
"1532/657/2016/09/21

        /record_1474440978934821_21255",
 "calluid": "1474440978.9348210002"
 },
 {
 "stype": "ivr",
 "snumber": "6208",
 "callername_external": "Melanie Fisher",
 "dtype": "queue",
 "dnumber": "1409",
 "start": "1474440987",
 "totaltime": "839",
 "talktime": "839",
 "uniqueid": "1474440978.934821-3-24710-internal",
 "status": "answer",
        "recording": "1532/657/2016/09/21/

        record_1474440978934821_21255",
 "calluid": "1474440978.9348210003"
 },
 {
 "stype": "queue",
 "snumber": "1409",
 "callername_external": "Melanie Fisher",
 "dtype": "phone",
 "dnumber": "1113843",
 "start": "1474441223",
 "totaltime": "676",
 "talktime": "652",
 "uniqueid": "1474441222.934982-2-24506-internal",
 "status": "answer",
        "recording":         "1532/657/2016/09/21/

        record_1474441222934982_22609",
 "calluid": "1474441222.9349820002"
        },

    ]

}