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

GET/phone/cdrs

Function


The GET/phone/cdrs method returns a list of call detail records for a telephone line(s). Each record of the response has the following fields of information:


  • ID - the unique ID of the CDR record.
  • phone - the phone line for which the record belongs to.
  • time - the time the call was made or received specified in Unix time format.
  • callid - a particular ID for the call itself
  • status -  indication of the eventual status of the call, like "answer", "hangup", "voicemail" etc. 
  • dir - the direction of the call, either "in" or "out." 
  • type - indicates the origination of the call, either "internal" or "external."
  • stype - indicates the type of communication point for the source caller. An internal caller will usually be indicated as "phone" while an outside caller will be indicated as "external".
  • snumber - the phone number of the source caller.
  • sname - the name (based on caller ID) for the source caller. 
  • dtype - indication of the type of destination point where the call ended, such as "mailbox", "access" etc. This will appear just as "external" for outbound calls since the system can't follow calls once they get out.
  • dnumber - the phone number of the destination.
  • duration - total duration of the call since it started ringing (including hold time and talk time), in seconds.
  • talktime - the duration of just the talk time of the call, in seconds.

Parameters


All parameters go in the header.


Parameter
Type
Operation
phone
string
The phone line(s) from which the list of CDRs is requested. Multiple phones can bee specified, separated by commas.
limit
integer
Specify the number of messages to be returned by the request.
offset
integer
Specify 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 list of CDRs for phone line 1284440 with a limit of 3 use this syntax:


HTTPS method: GET


webserv.telebroad.com/api/teleconsole/rest/phone/cdrs?phone=1284440&limit=3


Response:


{

"error":null,

    "result":[

        {"id":"41170161",

        "phone":"1284440",

        "time":"1524797420",

        "callid":"1524797409.1220700",

        "status":"answer",

        "dir":"in",

        "type":"external",

        "stype":"external",

        "snumber":"",

        "sname":"S RICHMND HL NY",

        "dtype":"access",

        "dnumber":"238",

        "duration":"39",

        "talktime":"27"

        },

        {"id":"41170046",

        "phone":"1284440",

        "time":"1524797275",

        "callid":"1524797264.1220658",

        "status":"answer",

        "dir":"in",

        "type":"external",

        "stype":"external",

        "snumber":"",

        "sname":"S RICHMND HL NY",

        "dtype":"access",

        "dnumber":"238",

        "duration":"83",

        "talktime":"70"

        },

        {

        "id":"41169891",

        "phone":"1284440",

        "time":"1524797142",

        "callid":"1524797099.08465678",

        "status":"answer",

        "dir":"in",

        "type":"internal",

        "stype":"phone",

        "snumber":"19173642125",

        "sname":"Dorothy Grubbs",

        "dtype":"",

        "dnumber":"12128334805",

        "duration":"49",

        "talktime":"45"

        },

        {

        "id":"2060193",

        "phone":"1284440",

        "time":"1521949723",

        "callid":"1521949679.84960013",

        "status":"answer",

        "dir":"in",

        "type":"internal",

        "stype":"phone",

        "snumber":"1113840",

        "sname":"Dorothy Grubbs",

        "dtype":"",

        "dnumber":"1113840",

        "duration":"50",

        "talktime":"41"

        }

    ]

}