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.
Name | Type | Description | Required | Default value |
---|---|---|---|---|
auth_username | String | Authentication username. | Yes | |
auth_password | String | Authentication password. | Yes | |
start | Integer | Start Unix timestamp. | Recommended | 0 |
end | Integer | End Unix timestamp. | Recommended | Now. |
customer | String or integer | Customer to get calls for. | No | Customer 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
Code | Description |
---|---|
200 | Success. |
400 | Invalid input parameters specified. Check the key and message fields for more details. |
401 | The authentication details provided are invalid. |
402 | Your role does not allow this. |
403 | Your 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
Version | Changes |
---|---|
4.0 | Function added. |