Overview of the calling extensions SDK
demo-minimal-js
:demo-react-ts
:npm start
command will automatically open a new tab in your browser at https://localhost:9025/, and you may need to bypass a “Your connection is not secure” warning in order to access the application.demo-minimal-js
or the demo-react-ts
:demo-minimal-js
:demo-react-ts
:eventHandlers
. You can find a full list of the available events in the Events section.
The following is a description of the events:
engagementId
to the app.engagementId
, then merges and updates the engagement with additional call details. Learn more about updating a call engagement via the APIor via the SDK.CallingExtensions
object. You can define the behavior of your extension by providing an option’s object when you create your extensions instance. This option’s object provides an eventHandlers
field where you can specify the behavior of your extension. The following code block illustrates the available options and event handlers you can define:
isReady
flag indicates whether the app is ready for production. This flag should be set to false
during testing.isReady
to true.
extensions
object provides the following event handlers that you can invoke to send messages to HubSpot or to specify other associated behavior. See examples below.
Property | Type | Description |
---|---|---|
isLoggedIn | Boolean | Checks if a user is logged in or not. |
engagementId | Number | A HubSpot created engagement ID. |
isAvailable | Number | Checks if a user is available or not. |
Property | Type | Description |
---|---|---|
externalCallId | String | A calling app created call ID. Used to enable calling in help desk. |
callStartTime | Number | Start time of call, in milliseconds. |
createEngagement | Boolean | Whether HubSpot should create an engagement for this call or not. When true, HubSpot will respond with onCreateEngagementSucceeded or onCreateEngagementFailed. |
fromNumber | String | The caller’s number. Required parameter. |
toNumber | String | The recipients phone number. |
Property | Type | Description |
---|---|---|
callStartTime | Number | Start time of call, in milliseconds. |
createEngagement | Boolean | Whether HubSpot should create an engagement for this call or not. When true, HubSpot will respond with onCreateEngagementSucceeded or onCreateEngagementFailed. |
toNumber | String | The recipients phone number. |
fromNumber | String | The caller’s number. Required parameter. |
dialingContext | Object | The dialing context is used for ticket and/or engagement creation when applicable. The object includes all properties of the onDialNumber payload. This property helps ensure data consistency by passing back the full dialing context between HubSpot and your third party app. |
Property | Type | Description |
---|---|---|
externalCallId | String | A calling app created call ID. Used to enable calling in help desk. |
Property | Type | Description |
---|---|---|
externalCallId | String | A calling app created call ID. Used to enable calling in help desk. |
engagementId | Number | A HubSpot created engagement ID. |
callEndStatus | Enumeration | The status of the call when ended. Statuses available:
|
hideWidget
property will be ignored when the user is in a task queue with the Call
task type.Property | Type | Description |
---|---|---|
engagementId | Number | A HubSpot created engagement ID. |
hideWidget | Boolean | Whether the widget should be hidden when the call is ended. Optional parameter. Defaults to true. |
engagementProperties | String | Opt in to hs owned engagements by adding properties. Causes HubSpot to respond with onUpdateEngagementSucceeded or onUpdateEngagementFailed. |
externalCallId | String | A calling app created call ID. Used to enable calling in help desk. |
Property | Type | Description |
---|---|---|
externalCallId | String | A calling app created call ID. Used to enable calling in help desk. |
engagementId | Number | A HubSpot created engagement ID. |
Property | Type | Description |
---|---|---|
engagementId | Number | A HubSpot created engagement ID. |
objectCoordinates | Object coordinates | References a portalId , objectId , and objectTypeID . |
Property | Type | Description |
---|---|---|
message | String | Error message to be displayed in the alert popup. |
Property | Type | Description |
---|---|---|
height | Number | Desired height of the call widget. |
width | Number | Desired width of the call widget. |
extensions
object provides the following event handlers that you can invoke when receiving messages in HubSpot or to specify other associated behavior. See examples below.
Property | Type | Description |
---|---|---|
engagementId | Number | A HubSpot created engagement ID. |
iframeLocation | Enum | widget : drag and drop widget shown in record pages when calling app doesn’t support inbound inbound calling.remote : frame in the navigation bar when calling app supports inbound calling.window : iframe in the calling window when calling app supports inbound calling. |
ownerId | String or Number | The ID of the logged in user in HubSpot. |
PortalId | Number | The ID of the HubSpot account. |
userId | Number | The ID of the HubSpot user. |
onDialNumber
event will provide a payload that includes all the pertinent fields associated with the call. These fields are detailed in the table below:
Property | Type | Description |
---|---|---|
phoneNumber | String | The phone number of the person that the HubSpot user called. |
ownerId | String or Number | The ID of the logged in user (in HubSpot). |
subjectId | Number | The ID of the subject. |
objectId | Number | Object type of the phone number. |
objectType | String | The object type associated with the phone number that was dialed (e.g., the phone number of the contact or company). The possible values here are "CONTACT" or "COMPANY" . |
portalId | Number | The ID of the HubSpot portal. |
countryCode | String | The country code of the phone number. |
calleeInfo | Array | Information about the callee. Should include the following:
|
startTimestamp | Number | Timestamp of the start of the call. |
toPhoneNumberSrc | String | The name of the phone numbers’ property in HubSpot. The property can be a standard property value or a custom property. For example, a contact may have three contact phone numbers, one may be labeled Office, another may be labeled Personal and the other may be labeled Mobile. |
Property | Type | Description |
---|---|---|
engagementId | Number | A HubSpot created engagement ID. |
Property | Type | Description |
---|---|---|
engagementId | Number | A HubSpot created engagement ID. |
objectCoordinates | Object coordinates | References a portalId , objectId , and objectTypeID . |
Property | Type | Description |
---|---|---|
engagementId | Number | A HubSpot created engagement ID. |
externalCallId | String | A calling app created call ID. Used to enable calling in help desk. |
Property | Type | Description |
---|---|---|
engagementId | Number | A HubSpot created engagement ID. |
externalCallId | String | A calling app created call ID. Used to enable calling in help desk. |
outgoingCall
event.
First, verify that the integration is using the Calling SDK to create engagements in the outgoingCall event:
createEngagement
is true, learn how to update your app information here.
Here is the example for the entire outgoingCall
event: