Page tree
Skip to end of metadata
Go to start of metadata
With the help of this method, you can list the presence of Extensions in particular contexts such as User, Organization or global.

Request/Response model

Overview

Use this request to list the presence status of one or several Extensions.

If successful, the Service returns a collection of Presence resources.

The request is made by an App that is registered to a User account.

To list the presence of extensions in a desired context, issue a HTTP GET request:

Model
HTTP-Method        = "GET"
URI-Fragment       = "/uapi/extensions/" User-Id "/" Extension-Number "/presence"
Query-Parameters   = Get-ExtensionPresence-Request-Parameters) 
Request-Payload    = null

Return-Object      = Collection<ExtensionPresence>
Example
GET /uapi/extensions/@me/0003*210/presence/ 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:

NameTypeRequiredDescription

userId

  User-Id

Yes

Id of the User which owns the Extensions for which the presence is returned.
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

Extended number of a Phone Terminal Extension.
Use @self to match all the extensions under the User.

Get ExtensionPresence request parameters

Restriction to Standard Request Parameters

All requests to list the Phone Calls support the Standard-Request-Parameters:

NameTypeDescription
countNumber

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

filterBy

String

Records can be filtered only by the extension field.

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

These additional parameters can be sent in the Query-Parameters:

NameTypeDescription

fields

Array<String>

An array of ExtensionPresence field names. For standard values, please see the Presence object.

Response

Success

If successful, a collection of Presence resources 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
400extension_invalidValue supplied in the URI-Fragment as extension is invalid. The parameter must reference the number of an existing Phone Terminal extension or can be set to @self.
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 possible Presence 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 Presence field.
400filterop_invalidValue supplied in filterOp parameter is missing or invalid. The parameter must be set to one of the values: contains, equals, starts with 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.

Example

Here is an example to help you understand the request and the response.

This example lists the presence of Extension 0003*210. The request is made by an App on behalf of a User.

HTTP Request
GET /uapi/extensions/@me/0003*210/presence/ HTTP/1.1
HOST uapi.voipnow.com
Content Type: application/json
Authorization: Bearer token

Assuming that the request has been successful, the Service answers with:

HTTP Response
HTTP/1.1 200 OK
...

{
 "startIndex":0,
 "totalResults":2,
 "itemsPerPage":20,
 "filtered":false,
 "sorted":false,
 "entry":[
  {
   "extension":"0003*210",
   "status":0,
   "registration": [
		{ 
        	"agent": "3CXPhone 5.0.14439.0",
	        "registration": "-1",
    	    "expire": "2011-02-10T15:10:55Z"
	    }
	]
  }
 ]
}
#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.