Excerpt |
---|
With the help of this method, you can list the presence of Extensions in particular contexts such as User, Organization or global. |
Table of Contents maxLevel 3 exclude Apps Using This, Quick Examples, Need Help?
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:
Panel | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||
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> |
Panel | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||
GET /uapi/extensions/@me/0003*210/presence/ HTTP/1.1
HOST |
Request
This section describes how to format the request to the service.
Anchor | ||||
---|---|---|---|---|
|
URI fragment
The following parameters must be sent in the URI fragment:
Name | Type | Required | Description |
userId | Yes | Id of the User which owns the Extensions for which the presence is returned. | |
extension | Yes | Extended number of a Phone Terminal Extension. |
Anchor | ||||
---|---|---|---|---|
|
Get ExtensionPresence request parameters
Restriction to Standard Request Parameters
All requests to list the Phone Calls support the Standard-Request-Parameters:
Name | Type | Description |
count | Number | The page size of a collection. |
filterBy | String | Records can be filtered only by the extension field. |
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
These additional parameters can be sent in the Query-Parameters:
Name | Type | Description |
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 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 | extension_invalid | Value 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. |
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 Presence 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 Presence 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, starts with 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. |
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.
Anchor | ||||
---|---|---|---|---|
|
Code Block | ||
---|---|---|
| ||
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:
Code Block | ||
---|---|---|
| ||
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" } ] } ] } |
Except where otherwise noted, content in this space is licensed under a Creative Commons Attribution 4.0 International.