Request/Response model
Overview
Use this service to retrieve a list of phone calls that occurred in the system.
If successful, the Service returns a collection of PhoneCall resources and the PhoneCallStat associated.
The request is made by an App that is registered to a User account.
To list the CDR in a desired context, issue a HTTP GET request:
HTTP-Method = "GET" URI-Fragment = "/uapi/cdr/" User-Id Query-Parameters = Get-CDR-Request-Parameters Request-Payload = null Return-Object = Collection<PhoneCallRecord>
GET /uapi/cdr/33 HTTP/1.1
HOST uapi.voipnow.com
Authorization: Bearer token Content Type: application/json
Request
A request to list the Phone Calls must support the Standard-Request-Parameters:
Restriction to Standard Request Parameters
Name | Type | Description |
---|---|---|
count | Number | The page size of a collection. |
filterBy | String | Records can be filtered only by source, destination, published and answered. |
filterValue | String | The value to filter by. |
startIndex | Number | The start index of the paged collection. Maximum possible value is 5000. Default: 0 |
Custom Request Parameters
The following parameters can also be used:
Name | Type | Description |
---|---|---|
source | UAPI-Extension-Number | The number that made the call. Can be an extended extension number or a public phone number. |
destination | UAPI-Extension-Number | The number that received the call. Can be an extended extension number or a public phone number. |
startDate | Date | Date when the call was answered. |
endDate | Date | Date when the call was answered. |
saveStartDate | Date | Date when the call was saved to the database. |
saveEndDate | Date | Date when the call was saved to the database. |
disposition | Number | The call disposition: 0 - ANSWERED - to fetch calls that were answered; 1 - BUSY - to get the calls that were answered with a busy tone 2 - FAILED - to fetch the calls that have failed 3 - NO ANSWER - to fetch the calls that had no answer 4 - UNKNOWN - to fetch the unknown calls 5 - NOT ALLOWED - to fetch the calls that were not allowed. |
fields | Array<String> | An array of PhoneCallStat field names. For standard values, please see the PhoneCallStat resource. |
Response
Success
If successful, returns a collection of PhoneCall resources, the PhoneCallStat associated, and the following HTTP statuses:
HTTP Code | Description |
---|---|
200 | The list of phone calls is returned. |
204 | There are no phone calls to be returned. |
Failure
When it fails, the request returns the following error codes:
HTTP Code | Code | Description |
---|---|---|
400 | fields_invalid | Value supplied in fields parameter is missing or invalid. The parameter must be set to a value of consisting of the name of the possible PhoneCall fields separated by a comma (e.g. extension, id, answered). |
400 | count_invalid | Value supplied in count parameter is missing or invalid. The parameter must be set to a numeric value lower than 5000. |
400 | filterby_invalid | Value supplied in filterBy parameter is missing or invalid. The parameter must be set to the name of a field used by CRD. |
400 | filterop_invalid | Value supplied in filterOp parameter is missing or invalid. The parameter must be set to one of the values: contains, equals, startsWith or present. |
400 | filtervalue_invalid | Value supplied in filterValue parameter is missing or invalid. The parameter must be set to a string value. |
400 | sortorder_invalid | Value supplied in sortOrder parameter is missing or invalid. The parameter must be set to one of the values: ascending or descending. |
400 | startindex_invalid | Value supplied in startIndex parameter is missing or invalid. The parameter must be set to a numeric value, higher or equal with 0 and lower than 5000. |
400 | cdr_user_invalid | Value supplied in the URI-Fragment as userId is invalid. The parameter must reference the Id of an user or can be set to @me or @viewer. |
400 | cdr_start_date_invalid | Value supplied in startDate parameter is invalid. |
400 | cdr_end_date_invalid | Value supplied in endDate parameter is invalid. |
400 | cdr_source_invalid | Value supplied in source parameter is invalid. |
400 | cdr_destination_invalid | Value supplied in destination parameter is invalid. |
400 | cdr_flow_invalid | Value supplied in flow parameter is invalid. |
400 | cdr_disposition_invalid | Value supplied in disposition parameter is invalid. |
400 | cdr_save_start_date_invalid | Value supplied in saveStartDate parameter is invalid. |
400 | cdr_save_end_date_invalid | Value supplied in saveEndDate parameter is invalid. |
Examples
Below you can find an example that will help you understand the request and the response.
This example lists the phone calls that were assigned to the User with Id 33. The request is made by an App on behalf of the Administrator.
GET /uapi/cdr/?ownerId=33 HTTP/1.1 HOST uapi.voipnow.com Authorization: Bearer token Content Type: application/json
Assuming the request has been successful, the Service returns the following answer:
HTTP/1.1 200 OK ... { "entry": { "53bec7de3c242d5f87e5": { "id":"53bec7de3c242d5f87e5", "ownerId":"33", ... "phoneCallView":[ { "source":"14141555", "destination":"0003*002", ... }, { "source":"14141555", "destination":"0003*006", ... } ] }, "ad5a65672e3f783665c0": { "id":"ad5a65672e3f783665c0", "ownerId":"33", "phoneCallView":[ { "source":"14141555", "destination":"0003*002", ... } ] }, ... }, "startIndex":0, "totalResults":34922, "itemsPerPage":20, "filtered":true, "sorted":true, "phoneCallStat":[ { "type":0, "total":17558, "unanswered":"4063", "busy":"5435", "failed":"3313", "unknown":0, "unallowed":0, "answered":"4747" }, { "type":1, ... } ], "paging":{...} }
Except where otherwise noted, content in this space is licensed under a Creative Commons Attribution 4.0 International.