Presence Service
The Presence Service is used to fetch the registration status for Extensions.
This service is available to Apps registered to the following account types:
Administrator
Organization
User
Base URL
https://{domain}/uapiEndpoints
| Method | Endpoint | Description |
|---|---|---|
| GET | /extensions/{userId}/{extension}/presence | List Presence |
List Presence
Use this request to list the presence status of one or several Extensions.
/extensions/{userId}/{extension}/presenceRequest
Path Parameters
| Parameter | Type | Required | Description | Default |
|---|---|---|---|---|
userId | string | Yes | Id of the User which owns the Extensions for which the presence is returned.It can take one of the following values: <ul> <li> @me - refers to the authenticated User . </li> <li>@viewer - also refers to the authenticated User .</li> <li>@owner - refers to the User that owns the Extension used to make the phone call. </li></ul> | - |
extension | string | Yes | Extended number of a Phone Terminal Extension. Use @self to match all the extensions under the User. The @self value can be used only if userId is different than @owner. | - |
Query Parameters
| Parameter | Type | Required | Description | Default |
|---|---|---|---|---|
count | count | No | - | |
filterBy | string | No | Records can be filtered only by the extension field. | - |
filterOp | string | No | Records can be filtered only by the extension field.
| - |
filterValue | filterValue | No | - | |
startIndex | startIndex | No | - | |
fields | array | No | An array of ExtensionPresence field names. For standard values, please see the Presence object. | - |
sortOrder | sortOrder | No | The parameter can be set to one of the values: asc or desc. Records will be ordered by the number of the extension. You are not allowed to set the field to sort by. | - |
Authentication
This endpoint requires authentication via cookie or header token.
Responses
200 OK
If successful, this method returns a 200 OK HTTP status code and a collection of Presence resources.
Example Response
[
{
"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"
}
]
}
]
}
]204 No Content
If there is no phone call to be returned, this method returns 204 No Content HTTP status code. It does not return anything in the response body.
400 Bad Request
If an error occurred, this API can return the standard Errors Codes or one the following:
Error codes:
401 Unauthorized
If the value supplied in the URI-Fragment as userId lacks the proper permissions for the requested operation.this API can return the standard Errors Codes or one the following:
Error codes:
Code Examples
cURL
curl 'https://api.hubgets.com/uapi/extensions/@me/0003*210/presence/?filterBy=extension&filterOp=inArray&filterValue[0]=0003*210' \
-H 'x-xsrf-token: 44HzZ6YIHDN6mbRY' \
-H 'content-type: application/json' \
-H 'cookie: dev=ffffffffffffffff2kjZMApYaH; xsrf-token=44HzZ6YIHDN6mbRY; vn=XI%2Cm-tpsEWgqBMBCNVpeAnUEaeqCpG7f' \
--data-binary '{"method":"0","note":"My phone call event is awesome","url":"http://myevent.com/SaveMyPhoneCallDetails","status":"1"}'