Page tree

This method allows getting a list of calls from the call history of a system in particular contexts such as User, Organization or global.

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:

Model
HTTP-Method       = "GET"
URI-Fragment      = "/uapi/cdr/" User-Id
Query-Parameters  = Get-CDR-Request-Parameters
Request-Payload   = null

Return-Object     = Collection<PhoneCallRecord>
Example
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

NameType Description
countNumber

The page size of a collection.
Maximum possible value is 5000.
Default: 20 entries

filterBy

String

Records can be filtered only by source, destination, published and answered.

filterValueStringThe value to filter by.
startIndexNumberThe start index of the paged collection.
Maximum possible value is 5000.
Default: 0

Custom Request Parameters

The following parameters can also be used:

NameType Description
sourceUAPI-Extension-NumberThe number that made the call. Can be an extended extension number or a public phone number.
destinationUAPI-Extension-NumberThe number that received the call. Can be an extended extension number or a public phone number.
startDateDateDate when the call was answered.
endDateDateDate when the call was answered.
saveStartDateDateDate when the call was saved to the database.
saveEndDateDateDate when the call was saved to the database.
dispositionNumberThe 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.
fieldsArray<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 CodeDescription
200The list of phone calls is returned.
204There are no phone calls to be returned.

Failure

When it fails, the request returns the following error codes:

HTTP CodeCodeDescription
400fields_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).

400count_invalidValue supplied in count parameter is missing or invalid. The parameter must be set to a numeric value lower than 5000.
400filterby_invalid

Value supplied in filterBy parameter is missing or invalid. The parameter must be set to the name of a field used by CRD.

400filterop_invalidValue supplied in filterOp parameter is missing or invalid. The parameter must be set to one of the values: contains, equals, startsWith or present.
400filtervalue_invalidValue supplied in filterValue parameter is missing or invalid. The parameter must be set to a string value.
400sortorder_invalidValue supplied in sortOrder parameter is missing or invalid. The parameter must be set to one of the values: ascending or descending.
400startindex_invalidValue 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.
400cdr_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.

400cdr_start_date_invalidValue supplied in startDate parameter is invalid.
400cdr_end_date_invalidValue supplied in endDate parameter is invalid.
400cdr_source_invalidValue supplied in source parameter is invalid.
400cdr_destination_invalidValue supplied in destination parameter is invalid.
400cdr_flow_invalidValue supplied in flow parameter is invalid.
400cdr_disposition_invalidValue supplied in disposition parameter is invalid.
400cdr_save_start_date_invalidValue supplied in saveStartDate parameter is invalid.
400cdr_save_end_date_invalidValue 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.

HTTP Request
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 Response
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":{...}
}


#trackbackRdf ($trackbackUtils.getContentIdentifier($page) $page.title $trackbackUtils.getPingUrl($page))
  • No labels

Except where otherwise noted, content in this space is licensed under a Creative Commons Attribution 4.0 International.