Skip to content
UnifiedAPI v5

PhoneCallEvents Service

The PhoneCallEvent Service is used to assign the following events to an Extension:

  • Dial-In: occurs when a call is received by an extension.

  • Dial-Out: occurs when a call is placed by an extension.

  • Hangup: occurs when the extension hangs up.

  • Answer on incoming call: occurs when an incoming phone call is answered.

  • Answer on outgoing call (by the other party): occurs when an outgoing phone call is answered by the other party.

The Service is available to Apps registered to the following account types:

  • Administrator

  • Organization

  • User

Base URL

https://{domain}/uapi

Endpoints

MethodEndpointDescription
POST/extensions/​{userId}/​{extension}/​phoneCallEvents/​{eventType}Create PhoneCallEvents
GET/extensions/​{userId}/​{extension}/​phoneCallEvents/​{eventType}/​{eventId}List PhoneCallEvents
PUT/extensions/​{userId}/​{extension}/​phoneCallEvents/​{eventType}/​{eventId}Update PhoneCallEvents
DELETE/extensions/​{userId}/​{extension}/​phoneCallEvents/​{eventType}/​{eventId}Delete PhoneCallEvents

Create PhoneCallEvents

Use this request to add call events to an Extension.

POST /extensions/​{userId}/​{extension}/​phoneCallEvents/​{eventType}

Request

Path Parameters

ParameterTypeRequiredDescriptionDefault
userIdstringYesId of the User which owns the Extension for which the event is added. 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>-
extensionstringYesThe number of the Extension for which the event is added. Allowed Extension types: Phone Terminal, Queue, Conference, and IVR. Cannot be set to @self.-
eventTypenumberYesThe type of the PhoneCallEvent. If missing events for all the types are returned. Must be given if eventId is sent.-

Authentication

This endpoint requires authentication via cookie or header token.

Payload

Type: PhoneCallEvent

Responses

200 OK

If successful, this method returns a 200 OK HTTP status code and the newly created PhoneCallEvent.

Response

PropertyTypeRequiredDescription
typestringYes
idstringYes
methodstringYes
notestringYes
urlstringYes
statusstringYes
modifiedstringYes
linksLinkYes
Example Response
json
{
  "PhoneCallEvent": {
    "type": "0",
    "id": "NqeyDRqo4FtabmFj8gNWq3hsiGNYyq",
    "method": "0",
    "note": "My phone call event is awesome",
    "url": "http://myevent.com/SaveMyPhoneCallDetails",
    "status": "1",
    "modified": "2012-07-10T18:16:12+03:00",
    "links": {
      "self": "https://x.x.x.x/uapi/extensions/@me/0003*210/phoneCallEvents/MyPhoneCallEvent"
    }
  }
}

204 No Content

If there is no PhoneCallEvent 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:

403 Forbidden

If an error occurred while verifying if the user is allowed to perform the operation, this API can return the standard Errors Codes or one the following:

Error codes:

500 Internal Server Error

If an error occurred, this API can return the standard Errors Codes or one the following:

Error codes:

Code Examples

cURL
shell
curl 'https://api.hubgets.com/uapi/extensions/@me/0003*210/phoneCallEvents/0/' \ 
 -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"}'

List PhoneCallEvents

This method allows listing existing phone call events in particular contexts such as User, Organization or global. Use this request to list phone call events which are assigned to an Extension.

GET /extensions/​{userId}/​{extension}/​phoneCallEvents/​{eventType}/​{eventId}

Request

Path Parameters

ParameterTypeRequiredDescriptionDefault
userIdstringYesId of the User which owns the Extension for which the event is added. 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>-
extensionstringYesThe number of the Extension for which the event is added. Allowed Extension types: Phone Terminal, Queue, Conference, and IVR. Cannot be set to @self.-
eventTypenumberYesThe type of the PhoneCallEvent. If missing events for all the types are returned. Must be given if eventId is sent.-
eventIdstringYesThe Id of an existing PhoneCallEvent.-

Query Parameters

ParameterTypeRequiredDescriptionDefault
countcountNo-
filterBystringNoRecords can be filtered by all fields of the PhoneCallEvent.-
filterValuefilterValueNo-
startIndexstartIndexNo-
fieldsfieldsNoAn array of Phone Call Event field names. For standard values, please see the PhoneCallEvent resource.-
sortOrdersortOrderNoThe parameter can be set to one of the values: asc or desc (E.g. sortOrder=desc). Records will be ordered by url. 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 PhoneCallEvent resources.

Example Response
json
[
  {
    "startIndex": 0,
    "totalResults": 1,
    "itemsPerPage": 5,
    "filtered": true,
    "sorted": true,
    "entry": [
      {
        "type": "0",
        "id": "NqeyDRqo4FtabmFj8gNWq3hsiGNYyq",
        "method": "0",
        "note": "My phone call event is awesome",
        "url": "http://myevent.com/SaveMyPhoneCallDetails",
        "status": "1",
        "modified": "2012-07-10T18:16:12+03:00",
        "links": {
          "self": "https://x.x.x.x/uapi/extensions/@me/0003*210/phoneCallEvents/0/NqeyDRqo4FtabmFj8gNWq3hsiGNYyq"
        }
      }
    ]
  }
]

204 No Content

If there is no PhoneCallEvent to be returned, this method returns 204 No Content HTTP status code. It does not return anything in the response body.

400 Bad Request

Error codes:

403 Forbidden

If an error occurred while verifying if the user is allowed to perform the operation, this API can return the standard Errors Codes or one the following:

Error codes:

Code Examples

cURL
shell
curl 'https://api.hubgets.com/uapi/extensions/@me/0003*210/phoneCallEvents/0/NqeyDRqo4FtabmFj8gNWq3hsiGNYyq' \ 
 -H 'x-xsrf-token: 44HzZ6YIHDN6mbRY' \ 
 -H 'content-type: application/json' \ 
 -H 'cookie: dev=ffffffffffffffff2kjZMApYaH; xsrf-token=44HzZ6YIHDN6mbRY; vn=XI%2Cm-tpsEWgqBMBCNVpeAnUEaeqCpG7f' \ 
 --data-binary '{"startIndex":0,"totalResults":1,"itemsPerPage":5,"filtered":true,"sorted":true,"entry":[{"type":"0","id":"NqeyDRqo4FtabmFj8gNWq3hsiGNYyq","method":"0","note":"My phone call event is awesome","url":"http://myevent.com/SaveMyPhoneCallDetails","status":"1","modified":"2012-07-10T18:16:12+03:00","links":{"self":"https://x.x.x.x/uapi/extensions/@me/0003*210/phoneCallEvents/0/NqeyDRqo4FtabmFj8gNWq3hsiGNYyq"}}]}'

Update PhoneCallEvents

Use this request to update a phone call event assigned to an Extension.

PUT /extensions/​{userId}/​{extension}/​phoneCallEvents/​{eventType}/​{eventId}

Request

Path Parameters

ParameterTypeRequiredDescriptionDefault
userIdstringYesId of the User which owns the Extension for which the event is added. 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>-
extensionstringYesThe number of the Extension for which the event is added. Allowed Extension types: Phone Terminal, Queue, Conference, and IVR. Cannot be set to @self.-
eventTypenumberYesThe type of the PhoneCallEvent. If missing events for all the types are returned. Must be given if eventId is sent.-
eventIdstringYesThe Id of an existing PhoneCallEvent.-

Authentication

This endpoint requires authentication via cookie or header token.

Payload

Request Payload

PropertyTypeRequiredDescription
methodstringNo
notestringNo
urlstringNo
statusstringNo

Example

json
{
  "method": "1",
  "note": "I want to use POST for my event"
}

Responses

200 OK

If successful, this method returns a 200 OK HTTP status code and the updated PhoneCallEvent.

Example Response
json
{
  "PhoneCallEvent": {
    "type": "0",
    "id": "NqeyDRqo4FtabmFj8gNWq3hsiGNYyq",
    "method": "1",
    "note": "I want to use POST for my event",
    "url": "http://myevent.com/SaveMyPhoneCallDetails",
    "status": "1",
    "modified": "2012-07-10T18:16:12+03:00",
    "links": {
      "self": "https://x.x.x.x/uapi/extensions/@me/0003*210/phoneCallEvents/MyPhoneCallEvent"
    }
  }
}

204 No Content

If there is no PhoneCallEvent 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:

403 Forbidden

If an error occurred while verifying if the user is allowed to perform the operation, this API can return the standard Errors Codes or one the following:

Error codes:

500 Internal Server Error

If an error occurred, this API can return the standard Errors Codes or one the following:

Error codes:

Code Examples

cURL
shell
curl 'https://api.hubgets.com/uapi/extensions/@me/0003*210/phoneCallEvents/0/NqeyDRqo4FtabmFj8gNWq3hsiGNYyq/' \ 
 -X 'PUT' \ 
 -H 'x-xsrf-token: 44HzZ6YIHDN6mbRY' \ 
 -H 'content-type: application/json' \ 
 -H 'cookie: dev=ffffffffffffffff2kjZMApYaH; xsrf-token=44HzZ6YIHDN6mbRY; vn=XI%2Cm-tpsEWgqBMBCNVpeAnUEaeqCpG7f' \ 
 --data-binary '{"method":"1","note":"I want to use POST for my event"}'

Delete PhoneCallEvents

This method allows deleting a phone call event in particular contexts such as User, Organization or global. Use this request to delete phone call events.

DELETE /extensions/​{userId}/​{extension}/​phoneCallEvents/​{eventType}/​{eventId}

Request

Path Parameters

ParameterTypeRequiredDescriptionDefault
userIdstringYesId of the User which owns the Extension for which the event is added. 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>-
extensionstringYesThe number of the Extension for which the event is added. Allowed Extension types: Phone Terminal, Queue, Conference, and IVR. Cannot be set to @self.-
eventTypenumberYesThe type of the PhoneCallEvent. If missing events for all the types are returned. Must be given if eventId is sent.-
eventIdstringYesThe Id of an existing PhoneCallEvent.-

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 the id of the deleted PhoneCallEvents.

Type: Array of object

Example Response
json
[
  {
    "id": "NqeyDRqo4FtabmFj8gNWq3hsiGNYyq"
  }
]

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:

403 Forbidden

If an error occurred while verifying if the user is allowed to perform the operation, this API can return the standard Errors Codes or one the following:

Error codes:

500 Internal Server Error

If an error occurred, this API can return the standard Errors Codes or one the following:

Error codes:

Code Examples

cURL
shell
curl 'https://api.hubgets.com/uapi/extensions/@me/0003*210/phoneCallEvents/0/NqeyDRqo4FtabmFj8gNWq3hsiGNYyq'  \ 
 -H 'x-xsrf-token: 44HzZ6YIHDN6mbRY' \ 
 -H 'content-type: application/json' \ 
 -H 'cookie: dev=ffhjshr2kjZMApYaH; xsrf-token=44HzZ6YIHDN6mbRY; vn=XI%2Cm-tpsEWgqBMBCNVpeAnUEaeqCpG7f' \ 
 --compressed
Last updated: Jan 13, 2026