JSON API » cdrs » cdrs/totals/list

Gets the fields of call totals for each of the intervals (hourly by default) that call totals are recorded for.

Input parameters

Requires authentication and the cdrs role privileges.

NameTypeDescriptionRequiredDefault value
auth_usernameStringAuthentication username.Yes
auth_passwordStringAuthentication password.Yes
startIntegerStart Unix timestamp.Recommended0
endIntegerEnd Unix timestamp.RecommendedNow.
customerString or integerCustomer to get calls for.NoCustomer of authentication user.

Failure to specify the start and end may put a heavy load on the database. If the start or end do not exactly correspond with the intervals call totals are measured in, only intervals entirely within the requested period are returned. Intervals partially outside the requested period are not returned.

Responses

CodeDescription
200Success.
400Invalid input parameters specified. Check the key and message fields for more details.
401The authentication details provided are invalid.
402Your role does not allow this.
403Your rate plan does not allow this.

Data returned

An array of fields, one row for each interval.

Example: With required and recommended parameters

http://enswitch.example.com/api/json/cdrs/totals/list/?auth_username=user;auth_password=password;start=1230000000;end=1240000000

{ "responses":[ { "code":"200", "key":"", "message":"OK" } ], "data":[ { "customer":2, "start":1230000000, "end":1230003599, "inbound":1, "outbound":2, "internal":3 }, { "customer":2, "start":1230003600, "end":1230007199, "inbound":4, "outbound":5, "internal":6 } ] }

Change history

VersionChanges
4.0Function added.