Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Updated using 4PSA automated script
Excerpt

This method allows listing of PhoneCalls resources in particular contexts such as User, Organization or global.

Table of Contents
maxLevel3
excludeApps Using This, Quick Examples, Need Help?

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.

Panel
borderColor#DADADA
bgColor#FFFFFF
titleBGColor#F0F0F0
borderWidth1
titleModel
borderStyledashed
HTTP-Method       = "GET"
URI-Fragment      = "/uapi/phoneCalls/" User-Id "/" Extension-Number [ "/" PhoneCall-Id ]
Query-Parameters  = multiple
Request-Payload   = null

Return-Object     = Collection<PhoneCall>
Panel
borderColor#DADADA
bgColor#FFFFFF
titleBGColor#F0F0F0
borderWidth1
titleExample
borderStyledashed

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

Anchor
urifragment
urifragment

The following parameters must be sent in the URI fragment.

NameTypeRequired Description

userId

User-Id

Yes

Id of the User that owns the an Extension involved in the call.
It can take one of the following values:
@me - refers to the authenticated User.
@viewer - also refers to the authenticated User.
@owner - refers to the User that owns the Extension used to make the phone call.
User-Id - refers to the unique identifier of the User.
Default: @me

extension

UAPI-Extension-Number

Yes

Number of the extension involved in the call.
Use @self to match all the extensions under the User.

phoneCallId

Object-Id

No

Id of a PhoneCall resource that must be updated.
If not provided all phone calls owned by Extension are parked.
If the Extension is unknown, you can use @self and phoneCallId to identify the phone call.
The PhoneCall Id can be retrieved using the List PhoneCalls request.

Query parameters

Anchor
phcall-list-query
phcall-list-query

All requests to list phone calls support the Standard-Request-Parameters and the custom fields parameter. All parameters are optional.

NameType InheritanceRestrictionsDescription
countNumberStandardMaximum value 5000

The page size of a collection.
Default: 20 entries

filterBy

String

Standard Phone call id or published date

Records can be filtered by PhoneCall id and published date.

filterValueString Standard Phone call id or published dateThe value to filter by.
startIndexNumber Standard Maximum value 5000 The start index of the paged collection.
Default: 0

fields

Array<String>

ParticularNone

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 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_invalidValue 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).
400count_invalidValue supplied in count parameter is missing or invalid. The parameter must be set to a numeric value lower than 5000.
400filterby_invalidValue supplied in filterBy parameter is missing or invalid. The parameter must be set to the name of a PhoneCall field.
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.

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.

Localtab Group
Localtab
activetrue
titleList Phone Calls of an Extension

This example lists all phone calls for extension 0003*210. The request is made by an App on behalf of a User.

Anchor
phcall-ex1
phcall-ex1

Code Block
titleHTTP Request
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:

Code Block
titleHTTP Response
 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":{...}
}

Localtab
titleList All Phone Calls

The example below lists a phone call with Id b817d2618fe6f1804db1. The request is made by an App on behalf of a User.

Anchor
phcall-ex2
phcall-ex2

Code Block
titleHTTP Request
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:

Code Block
titleHTTP Response
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.