Request/Response model
Overview
This request lists the phone calls that are in the system at a given time.
If successful, it returns a collection of PhoneCall resources that contain details only about the phone call.
The request is made by an App that is registered to a User account.
To list a single phone call, you must send the PhoneCall Id to the Service. To list the phone calls in a desired context, issue a HTTP GET request.
HTTP-Method = "GET" URI-Fragment = "/uapi/phoneCalls/" User-Id "/" Extension-Number [ "/" PhoneCall-Id ] Query-Parameters = multiple Request-Payload = null Return-Object = Collection<PhoneCall>
GET /uapi/phoneCalls/12/0003*210/b817d2618fe6f1804db1 HTTP/1.1
HOST uapi.voipnow.com
Content Type: application/json
Authorization: Bearer token
Request
This section describes how to format the request to the service.
URI fragment
The following parameters must be sent in the URI fragment.
Name | Type | Required | Description |
---|---|---|---|
userId | Yes | Id of the User that owns the an Extension involved in the call. | |
extension | Yes | Number of the extension involved in the call. | |
phoneCallId | No | Id of a PhoneCall resource that must be updated. |
Query parameters
All requests to list phone calls support the Standard-Request-Parameters and the custom fields parameter. All parameters are optional.
Name | Type | Inheritance | Restrictions | Description |
---|---|---|---|---|
count | Number | Standard | Maximum value 5000 | The page size of a collection. |
filterBy | String | Standard | Phone call id or published date | Records can be filtered by PhoneCall id and published date. |
filterValue | String | Standard | Phone call id or published date | The value to filter by. |
startIndex | Number | Standard | Maximum value 5000 | The start index of the paged collection. Default: 0 |
fields | Array<String> | Particular | None | An array of PhoneCall field names. For standard values, please see the PhoneCall resource. |
Response
Success
If successful, the request returns a collection of PhoneCalls 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 posible 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 PhoneCall field. |
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. |
Response body
If any 4xx or 5xx status codes is returned, the body contains the error response . When the request is successful and 200 OK is returned, the body contains a JSON representation.
Examples
Below you can find two examples that will help you understand the request and the response.
This example lists all phone calls for extension 0003*210. The request is made by an App on behalf of a User.
GET /uapi/phoneCalls/@me/210 HOST uapi.voipnow.com Content Type: application/json Authorization: Bearer token
Assuming that the request has been successful, the Service sends the following answer:
HTTP/1.1 200 OK ... { "entry":[ { "id":"b817d2618fe6f1804db1", "extension":"210", "ownerId":"3", "ownerName":"Default Organization", "answered":"2012-06-27T16:08:55+03:00", "published":"2012-06-27T16:08:50+02:00", "phoneCallView":[ { "id":"00", "extension":"210", "answered":"2012-06-27T16:08:55+03:00", "status":"5", "callerId":"John Doe <3333>", "source":["210"], "destination":["3235742879"] } ], "links":{...} }, { "id":"b817d2618fe6f1804333", "extension":"210", "ownerId":"3", "ownerName":"Default Organization", "answered":"2012-06-27T16:08:55+03:00", "published":"2012-06-27T16:08:50+02:00", "phoneCallView":[ { "id":"00", "extension":"210", "answered":"2012-06-27T16:08:55+03:00", "status":"5", "callerId":"John Doe <3333>", "source":["7778888"], "destination":["210"] } ], "links":{...} } ], "startIndex":0, "totalResults":2, "itemsPerPage":20, "filtered":false, "sorted":false, "paging":{...} }
The example below lists a phone call with Id b817d2618fe6f1804db1. The request is made by an App on behalf of a User.
GET /uapi/phoneCalls/12/0003*210/b817d2618fe6f1804db1 HTTP/1.1 HOST uapi.voipnow.com Content Type: application/json Authorization: Bearer token
Assuming the request has been successful, the Service returns the following answer:
HTTP/1.1 200 OK ... {"entry": [{"id":"b817d2618fe6f1804db1", "extension":"0003*210", "ownerId":"3", "ownerName":"Default Organization", "answered":"2012-06-27T16:08:55+03:00", "published":"2012-06-27T16:08:50+02:00", "phoneCallView":[ { "id":"00", "extension":"0003*210", "answered":"2012-06-27T16:08:55+03:00", "status":"5", "callerId":"John Doe <323-574-2879>", "source":["0003*210"], "destination":["3235742879"] } "links":{...} ] }], "startIndex":0, "totalResults":1, "itemsPerPage":20, "filtered":false, "sorted":false "paging":{...} }
Except where otherwise noted, content in this space is licensed under a Creative Commons Attribution 4.0 International.