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

GET/calls/recent

The GET/calls/recent request returns a list of recent call records (or call flow segments) between the user's line and a specific phone number. 


The request returns the following fields of information:

  • callid - an unique system ID for the call record. 
  • phone - the user's phone line that received or dialed the number.
  • time - the start time of the call in Unix time.
  • callid - an ID for the call or call segment, based on its start time, direction and other values.
  • status - indication of the status of the call (or call segment) in terms of connection between the caller and recipient. Possible responses include "answer","noanswer" (by the recipient), "cancel" (by the caller), "congestion" (too much traffic preventing a connection), "busy" (the recipient is on another call), or "chanunavail" - the destination communication channel is unavailable or the requested peer is not be registered.
  • dir - direction of the call or call segment. A value of "in" for inbound call, "out" for outbound call, or "internal" for a segment that has been routed internally.
  • type - a system designation for the current general type of the call segment being either "internal" or "external"
  • stype - a definition for the type of source point, where the call or call segment originated from. This will always be either "external" or a blank string for an inbound call from an outside source. Otherwise it can be any of numerous points on the PBX - "ivr", "accessmenu, "queue", "extension", "access", etc.
  • snumber -  the phone number of the source point that initiated the call. This can be, depending on the direction of the call, either an internal extension/number, a full telephone number, or a temporary number assigned by the system to the point in case it doesn't have one (such as in the case of an IVR).
  • sname - a name identified by the system for the source point of the call or call segment based on internal PBX information or caller ID. An empty string or the snumber may appear here if the system cannot obtain the relevant information or when the source is the IVR or a group.
  • dtype - a definition for the type of destination point (where the call was routed to) for the call or call segment. Examples can be "ivr", "accessmenu, "queue", "phone", etc. The type will always be "external" for outbound calls.
  • dnumber - the phone number of the destination point where the call was routed to for the call or call segment.
  • ctype - a definition for the type of called point (where the source customer originally dialed) in the current call or call segment. It is assigned by the system based on the progression of the call in the call flow.
  • cnumber - the phone number of called point (where the source customer originally dialed) in the current call or call segment. It is assigned by the system based on the progression of the call in the call flow.

    Note that for inbound and internal calls the ctype and cnumber parameters will differ from dtype and dnumber only in the first segment or two. After that they are usually identical.
  • duration - the total time, in seconds, for the call or call segment since it was initiated.
  • talktime - the talk time, in seconds, for the call or call segment since it was answered.

Parameters

Parameter
Type
Operation
phone
String
(optional) The user's phone line, if he has more than one line, that received or dialed the specific phone number.
numberStringThe specific phone number. 
startInteger

(optional) The starting time for listing relevant records in Unix time.

limit
Integer

(optional) Specify a limit on the number of voicemails to be returned by the request (default is 10.).

Example


To see three call records between the user and phone number 1-323-704-5050 use this syntax:


HTTPS method: GET


webserv.telebroad.com/api/teleconsole/rest/calls/recent?number=13237045050&limit=3


Response:


If the specified phone number is not found -


{

  "error": null,

  "result": []

}


Otherwise -


{

  "error": null,

  "result": [      

        {

        "id": "858804070",

        "phone": "1113840",

        "time": "1591080107",

        "callid": "1591080107.343707",

        "status": "answer",

        "dir": "in",

        "type": "internal",

        "stype": "",

        "snumber": "13237045050",

        "sname": "13237045050",

        "dtype": "mailbox",

        "dnumber": "1113838",

        "ctype": "",

        "cnumber": "1113838",

        "code": "",

        "duration": "241",

        "talktime": "234"

        },

        {

        "id": "858803990",

        "phone": "1113840",

        "time": "1591080017",

        "callid": "1591080017.640612",

        "status": "answer",

        "dir": "out",

        "type": "external",

        "stype": "",

        "snumber": "1113838",

        "sname": "1113838",

        "dtype": "external",

        "dnumber": "13237045050",

        "ctype": "",

        "cnumber": "13237045050",

        "code": "",

        "duration": "41",

        "talktime": "15"

        },

        {

        "id": "858803987",

        "phone": "1113852",

        "time": "1591079910",

        "callid": "1591079910.122500",

        "status": "answer",

        "dir": "out",

        "type": "external",

        "stype": "",

        "snumber": "1113838",

        "sname": "1113838",

        "dtype": "external",

        "dnumber": "13237045050",

        "ctype": "",

        "cnumber": "13237045050",

        "code": "",

        "duration": "58",

        "talktime": "32"

        },

        ]

}