Data Types
This page describes the data types used in the UnifiedAPI.
PhoneCallStat
A phone call record saved by the system is represented by the UnifiedAPI as a PhoneCall resource. Statistics about the phone call activity are represented as a PhoneCallStat resource.
Type: object
Properties
| Property | Type | Required | Description |
|---|---|---|---|
type | number | No | Type of the call:
|
total | number | No | Total number of phone calls. |
answered | number | No | Number of answered phone calls. |
unanswered | number | No | Number of unanswered phone calls. |
unknown | number | No | Number of unknown phone calls. |
busy | number | No | Number of busy phone calls. |
failed | number | No | Number of failed phone calls. |
unallowed | number | No | Number of phone calls that were refused by the system. |
Example
{
"type": 0,
"total": 17558,
"unanswered": "4063",
"busy": "5435",
"failed": "3313",
"unknown": 0,
"unallowed": 0,
"answered": "4747"
}Fax
A fax is represented by UnifiedAPI as a Fax resource with the following components.
Type: object
Properties
| Property | Type | Required | Description |
|---|---|---|---|
id | number | No | Id of the fax. |
uid | string | No | The unique Id of the Fax, used in the public fax page. |
recipients | Array<string> | No | The recipients of the Fax. The numbers may be extended or short (in case of Phone Terminal extensions). |
files | Array<FaxFile> | No | Array of files to be sent with the fax. Each file must include name, size, and type. |
Example
{
"id": 262,
"uid": "ba123e75751d52b84f6527062fd20bd1",
"recipients": [
"1112",
"1234567890"
],
"files": [
{
"uploadIdentifier": "doc001",
"redirect": true,
"heUri": "https://api.hubgets.com/at/file/action?id=31mMULR90JvqyO&ver=31n3mJOAMcMtWM&nm=document.pdf&cl=OTHER&vw=main",
"redirectUri": "https://storage.example.com/bucket/file?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=...&X-Amz-Signature=...",
"redirectHeaders": {
"x-amz-meta-he-int-faxout": 1,
"x-amz-meta-he-aid": "1",
"x-amz-meta-he-aty": "USER",
"x-amz-meta-he-nm": "document",
"x-amz-meta-he-ext": "pdf",
"x-amz-meta-app-faxid": 262,
"x-amz-meta-app-filecount": 2
},
"contentType": "application/pdf",
"contentLength": 1048576
},
{
"uploadIdentifier": "img001",
"redirect": true,
"heUri": "https://api.hubgets.com/at/file/action?id=31bQgIU1shao5z&ver=31ASZnnrd1m25i&nm=image.jpg&cl=OTHER&vw=main",
"redirectUri": "https://storage.example.com/bucket/file2?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=...&X-Amz-Signature=...",
"redirectHeaders": {
"x-amz-meta-he-int-faxout": 1,
"x-amz-meta-he-aid": "1",
"x-amz-meta-he-aty": "USER",
"x-amz-meta-he-nm": "image",
"x-amz-meta-he-ext": "jpg",
"x-amz-meta-app-faxid": 262,
"x-amz-meta-app-filecount": 2
},
"contentType": "image/jpeg",
"contentLength": 524288
}
]
}PhoneCallView
Describes a phone call leg in real-time.
Type: object
Properties
| Property | Type | Required | Description |
|---|---|---|---|
id | ObjectId | No | The Id of the PhoneCallView as generated by the Service. The Id of the view can be used later to edit the call. |
callerId | Caller-Id | No | The caller Id. Can be NULL |
callerIdDestination | Caller-Id | No | The caller name and number. It is displayed to the destination. |
extension | Extension-Number | No | The phone number of the Extension. The PhoneCallView is from the perspective of this extension. |
status | number | No | The status of the call, which is set to:
|
source | Array<string> | No | The number that made the call. Can be an extended extension number or a public phone number. |
destination | Array<string> | No | The number that received the call. Can be an extended extension number or a public phone number. |
flow | number | No | The flow of the call, which is set to:
|
ringing | Date | No | The date when the source terminal started ringing. Can be missing if the call is answered. |
recording | Date | No | The date when the phone call started to be recorded. Can be missing if the call is not recorded. |
answered | Date | No | The date the source answered the call. Can be missing if the call is ringing. |
parked | Date | No | The date when the phone call was parked. Can be missing if the call is not parked. |
parkedPos | number | No | The position of the call in the parking lot. Can be NULL |
parkedBy | Extension-Number | No | The number that put the phone call in the parking lot. Can be NULL |
disposition | number | No | The call disposition:
|
onHold | Date | No | The date the phone call was put on hold. Can be NULL |
holder | number | No | If set to 1, this peer put the phone call on hold. Can be NULL |
spying | number | No | This flag is set to 1 if the extension is spying it's peer. This can be the case when a barge in or whisper is attempted. Can be NULL |
queue | Extension-Number | No | The phone number of the queue extension. Used when a call is routed using a queue. Can be NULL |
PhoneCallAction
During its lifetime, a phone call can be put on hold, parked, recorded or manipulated using other actions. These actions are represented as the PhoneCallAction object by UnifiedAPI.
Type: object
Properties
| Property | Type | Required | Description |
|---|---|---|---|
action | string | No | The type of action to perform. Possible values: Possible values: OnHold, OffHold, StartRecording, StopRecording, PickUp, BargeIn, Park, UnPark, Whisper, Monitor, Transfer, TransferToVoicemail |
sendCallTo | string | No | Some actions need a phone number to send the call to. This field should contain the number. |
callerId | Caller-Id | No | When a call is barged in or is whispered on, a caller Id can be sent to the Service. |
waitForPickup | number | No | The maximum number of seconds to wait until one of the phone numbers used picks up. As soon as the set time value runs out, the call is canceled. |
phoneCallViewId | string | No | The Id of PhoneCallView that is subject to the change. |
format | string | No | Used only when recording a phone call and must be set to the format of the recorded file. |
maxInParking | number | No | The maximum number of seconds to wait until the parking ends. As soon as the set time value runs out, the parking is canceled. |
Example
{
"action": "PickUp",
"sendCallTo": "0003*210*",
"callerId": "John Doe <42420042>",
"waitForPickup": "20",
"phoneCallViewId": "zz",
"maxInParking": "400"
}PhoneRegistration
Type: object
Properties
| Property | Type | Required | Description |
|---|---|---|---|
registration | number | No | Defines registration status. Possible values:
|
agent | string | No | Defines the User-Agent of the connected device. |
expire | Date | No | Specifies registration expiration date. Missing when registration has expired. |
Example
{
"agent": "3CXPhone 5.0.14439.0",
"registration": "-1",
"expire": "2011-02-10T15:10:55Z"
}Collection
Structure used to return objects requested through the API.
Type: object
Properties
| Property | Type | Required | Description |
|---|---|---|---|
entry | Array<object> | No | An array of objects, one for each item matching the request. |
startIndex | number | No | The index to start with when retrieving chunks. If you do not supply this property, then it will be assumed zero. To retrieve next or previous chunk, use the nextChunk, respectively prevChuck returned in response object. |
itemsPerPage | number | No | The size of the chunk. |
filtered | boolean | No | Whether the results are filtered. It takes into the consideration the default filterBy. |
sorted | boolean | No | Whether the results are sorted. |
paging | Paging | No | See Paging |
Example
{
"entry": [],
"startIndex": 20,
"totalResults": 415,
"itemsPerPage": 20,
"filtered": true,
"sorted": true,
"paging": {
"next": "https://api.hubgets/uapi/cdr/20?startIndex=50",
"prev": "https://api.hubgets/uapi/cdr/20?startIndex=10"
}
}PhoneCall
A phone call is represented by UnifiedAPI as a PhoneCall resource and contains the PhoneCallView components which describes the phone call from the perspective of the parties involved in the phone call.
Type: object
Properties
| Property | Type | Required | Description |
|---|---|---|---|
id | ObjectId | No | The Id of the PhoneCall as saved in the system. The Id is generated by the Service and can be later used to list or edit the PhoneCall details. |
extension | Extension-Number | No | The number of the Extension that is charged for the phone call. This Extension might not be a party of the phone call. |
ownerId | ObjectId | No | The Id of the Organization that owns the PhoneCall. |
ownerName | string | No | The name of the Organization that owns the PhoneCall. |
answered | Date | No | The date the phone call was answered. Can be NULL. |
published | Date | No | The date the phone call entered the system. |
phoneCallView | PhoneCallView | No | The legs of the call, we call them views. |
nonce | string | No | A unique string that allows identifying the call created based on this request. |
Example
{
"id": "b817d2618fe6f1804333",
"nonce": "130c5a97768be67df6543b5f5fa3cc51",
"extension": "0003*210",
"ownerId": "53tete535",
"ownerName": "53tete535",
"published": "2011-02-10T15:04:55Z",
"answered": "2011-02-10T15:10:55Z",
"phoneCallView": [
{
"id": "00",
"extension": "0003*210",
"source": [
"0003*211",
"0003*210"
],
"destination": [
"3334444"
],
"flow": 4,
"status": 3,
"ringing": "2011-02-10T15:04:55Z",
"callerID": "John Doe <3332222>"
},
{
"id": "01",
"extension": "0003*211",
"source": [
"0003*211",
"0003*210"
],
"destination": [
"3334444"
],
"flow": 4,
"status": 3,
"ringing": "2011-02-10T15:04:55Z",
"callerID": "John Doe <3332222>"
}
],
"links": {
"self": "..."
}
}PhoneCallEvent
A phone call event is represented by the UnifiedAPI as a PhoneCallEvent resource.
Type: object
Properties
| Property | Type | Required | Description |
|---|---|---|---|
id | ObjectId | No | Id of the Phone Call Event. |
type | number | No | Type of the Phone Call Event.
|
url | string | No | The URL that is accessed when the extension receives, makes or terminates a phone call. Must be encoded using the RFC 3986. |
method | number | No | The HTTP method used by the server to access the URL when an event occurs.
|
status | number | No | TheThe status of the event.
|
note | string | No | Notes about the event. |
modified | Date | No | Date when the event was last modified. |
Example
{
"type": 0,
"id": "NqeyDRqo4FtabmFj8gNWq3hsiGNYyq",
"method": 0,
"note": "My extension event is awesome",
"url": "http://mynEvent.com/SaveMyPhoneCallDetails",
"status": 1,
"modified": "2012-07-10T18:16:12+03:00"
}Presence
The presence information for an extension is represented by the UnifiedAPI as a Presence resource. It contains the agent where the extension is registered and the expiration date of the registration.
Type: object
Properties
| Property | Type | Required | Description |
|---|---|---|---|
registration | PhoneRegistration | No | See PhoneRegistration |
status | number | No | Defines presence status. Possible values:
|
extension | Extension-Number | No | The phone number of the extension. |
Example
{
"status": "1",
"extension": "0003*001",
"registration": [
{
"agent": "3CXPhone 5.0.14439.0",
"registration": "1",
"expire": "2011-02-10T15:10:55Z"
}
]
}QueueAgent
A queue agent is represented by the UnifiedAPI as a Agent resource.
Type: object
Properties
| Property | Type | Required | Description |
|---|---|---|---|
agentNumber | string | No | Phone number assigned to a queue agent. |
status | number | No | The agent's current status in the queue:
|
queue | Extension-Number | No | Phone number of the queue where the agent is assigned to |
type | Agent-Type | No | Queue agent type |
identifier | Agent-Identifier | No | Queue agent identifier |
Example
{
"agentNumber": "0003*210",
"status": 1,
"queue": "0003*003",
"type": "local",
"identifier": "agentIdentifier",
"links": {
"self": "https://x.x.x.x/uapi/extensions/@me/0003*003/queue/agents/agentUniqueId"
}
}