Skip to content

Call Log

Request

Retrieve a list of call records for the current day.

Explanation of Return Value

The data object in the return result contains the following keys:

KeyDescription
cdrAn array of call records. Each call is represented by an object. The format of this object is discussed below.
tot / callsThe total number of calls returned in the cdr array.
optionsInidicates if any cached data should be cleared. See the Data Caching documentation for more information.
Call Objects

Each object in the cdr array represents a single call record, and includes the following keys:

KeyDescription
idThe ID of the call. This is the ID that should be passed to the lastcdr parameter in subsequent API calls to retrieve only newer calls.
dateThe time that the call started, represented as the number of seconds since the UNIX epoch.
externalAn object representing the non-AVANSER phone number involved in the call. avanser is the phone number in AVANSER format, and cutamper is a unique identifier for this phone number.
adSourceThe AdSource name of the AVANSER BNUM.
statusAn integer representing the call status. The meaning of each possible value is listed in the table below.
durationThe duration of the call in seconds.
internalAn object representing the answerpoint for inbound calls, or the from number for outbound calls. avanser is the phone number in AVANSER format, and name is the answerpoint name.
countryThe country that the call originated from.
stateThe state that the call originated from.
locationThe location that the call originated from.
audioAn object representing an audio file associated with a call. url is the URL to access the audio file (or an empty string if there is no audio file associated with the call), and type is a string representing the type of audio, either recording or message.
directionThe direction of the call. Possible values are call-in and call-out.

Note: Calls in the cdr array are returned in reverse-chronological order, with the newest call appearing first in the array.

When making a subsequent API call to retrieve newer calls, the application should pass the highest ID value in the lastcdr parameter.

Call Statuses

The table below lists the meaning of each of the possible integer values returned in the status key:

Status CodeDescription
0Abandoned
1Answered
2Busy
3Unanswered
4, 5Reserved
6Fax
Security
accessToken
Query
lastcdrnumber

The ID of the most recently retrieved call. If provided, only newer calls will be retrieved. If omitted, all calls for the logged in user will be retrieved.

curl -i -X GET \
  'https://p3.avanser.com/app/calls?lastcdr=0&token=YOUR_API_KEY_HERE'

Responses

Call records for the current day.

Bodyapplication/json
timestampintegerrequired

The time that the API response left the server, represented as the number of seconds since the UNIX epoch.

Example:1508903167
exectionnumber

The number of seconds that it took to process the API request.

Example:0.00041531896591187
errorbooleanrequired

Boolean indicating whether there was an error returned by the API request.

Example:false
dataobjectrequired

The data returned by the API. The format varies depending on the API function that was called.

Response
{ "timestamp": 1510092008, "exection": 0.0013340220451355, "error": false, "data": { "tot": 5, "cdr": [ … ], "calls": 5, "options": null } }