Webhooks
Webhooks enable administrators to capture changes and events from the myCloudPBX customer portal or a PBX. Using webhooks, external workflows can be triggered. For instance, when a client creates a new myCloudPBX extension, a webhook can create a callback request in your CRM for an account manager to perform a wellness check.
A webhook allows two applications to communicate and share real-time data by pushing information from one application to another, unlike an API which pulls data.
myCloudPBX Webhooks can also provide live data feeds to third-party or external billing systems.
There are two main types of Webhooks that can be enabled:
- myCloudPBX Webhooks: These Webhooks are specific to an account.
- Service Webhooks: This integration is specific to one PBX.
myCloudPBX Webhooks
myCloudPBX Webhooks include the following:
- Create User
- Delete User
- Modify User
From the 'My Admin' menu, select 'Webhooks'.
On this page, you can see all of your active Webhooks.
- Name: This name is for your reference.
- Type: Currently Webhook only.
- Trigger Service Type: This is the trigger, currently myCloudPBX only.
- Trigger Event: Create User, Delete User, etc.
Controls
Edit | |
---|---|
Disable | |
Enable |
Configuration Overview
To create a new Webhook, click 'Create New Webhook'.
Enter the following information:
- Webhook Name: This is for your reference
- Type: Webhook
- Request URL: The URL the payload will be sent to.
- Method: POST | GET. Most endpoints will use POST. GET support for legacy applications.
- Format: JSON | QUERY. JSON payload or QUERY string.
- Path Arguments: Additional path arguments.
- Trigger Service Type: Service type.
Enter the following information:
- Authentication Type: None | Basic Auth | Token.
- Username: Username [optional]
- Password: Password [optional]
- Token: Token [optional]
A custom HTTP header can be added to requests, a typical request will start with X-
, for example X-{myvalue}
.
Enter the following information:
- Request Name: Name of the custom header value.
- Request Value: Value to be sent.
Field Values
The payload can be customised by selecting a predetermined value from the drop down list. In all cases the Request Key can be configured to align with your application. The following values are specific to the myCloudPBX service type.
- Extension Number: myCloudPBX users configured extension number.
- Name: myCloudPBX users name.
- Outbound Phone Number: Outbound number configured for the extension.
- Has Voicemail: True: Voicemail is enabled. False: Voicemail is disabled.
- Enabled Calls: Comma separated list of call types enabled for the extension. Local, National, Mobile, International, International Other, Premium, Other.
- Date/Time: Date and Time of the request.
- Service UUID: Unique identifier of the service. A list of service UUIDs can be obtained using myCloudPBX API.
- Service Name: System configured name of the service.
- Service Friendly Name: User configured name of the service.
When you are finished, click 'Save & Close'.
Service Webhooks
Service Webhooks include the following:
- Inbound Call Received: Webhook will fire when an inbound call is received.
- Inbound Call Answered: Webhook will fire when an inbound call is answered by a user.
- Outbound Call Placed: Webhook will fire when an outbound call is placed.
- IVR Call Received: Webhook will fire when a call reaches an IVR.
- IVR Option Selected: Webhook will fire after the caller has selected an option on an IVR.
Enabling Service Webhooks
From the PBX main page, click 'Manage Applications'.
Place a tick in the box to enable Applications.
Service Webhooks Configuration
From the PBX main page, click 'Webhooks'.
On this page, you can see all of your active Webhooks.
- Name: This name is for your reference.
- Type: Crrently Webhook only.
- Trigger Service Type: This is the trigger, currently myCloudPBX only.
- Trigger Event: Inbound Call Answered, Outbound Call Placed, etc.
Controls
Edit | |
---|---|
Disable | |
Enable |
Service Integration Configuration
To create a new Webhook, click 'Create New Webhook'.
Enter the following information:
- Webhook Name: This is for your reference
- Type: Webhook
- Request URL: The URL the payload will be sent to.
- Method: POST | GET. Most endpoints will use POST. GET support for legacy applications.
- Format: JSON | QUERY. JSON payload or QUERY string.
- Path Arguments: Additional path arguments.
- Trigger Service Type: Service type.
Enter the following information:
- Authentication Type: None | Basic Auth | Token.
- Username: Username [optional]
- Password: Password [optional]
- Token: Token [optional]
A custom HTTP header can be added to requests, a typical request will start with X-
, for example X-{myvalue}
.
Enter the following information:
- Request Name: Name of the custom header value.
- Request Value: Value to be sent.
Field Values
The payload can be customised by selecting a predetermined value from the drop down list. In all cases the Request Key can be configured to align with your application. The following values are specific to the myCloudPBX service type.
- Extension Number: myCloudPBX users configured extension number.
- Name: myCloudPBX users name.
- Outbound Phone Number: Outbound number configured for the extension.
- Has Voicemail: True: Voicemail is enabled. False: Voicemail is disabled.
- Enabled Calls: Comma separated list of call types enabled for the extension. Local, National, Mobile, International, International Other, Premium, Other.
- Date/Time: Date and Time of the request.
- Service UUID: Unique identifier of the service. A list of service UUIDs can be obtained using myCloudPBX API.
- Service Name: System configured name of the service.
- Service Friendly Name: User configured name of the service.
- Source Number: Source phone number that placed the call.
- Destination Number: Destination phone number that was dialled.
- Call UUID: The Unique identifier of the call.
- IVR Name: The name of the IVR.
- Option Selected: The option selected by the caller at the IVR.
- Talker: True: Call has been answered. False: Call was not answered (or diverted externally)
Tip
Not all request values will be available for every trigger event.
Tip
A call picked up via the **
Method will not be seen as an 'answered call' via the webhook as it is technically considered an outbound, internal call.
When you are finished, click 'Save & Close'.
Example Webhooks
Net Promoter Score (NPS)
A Net Promoter Score (NPS) Application is an example of something that can easily be create by making use of the 'IVR Selected' webhook trigger.
Configuration
To create the required application you would need to do a few things.
-
Enable the 'IVR Selected' Webhook and configure the 'Request URL' to point to your webserver.
-
Create an IVR in myCloudPBX to capture the NPS score.
-
Create a virtual extension specifically for the newly created IVR.
-
Write a basic application to accept the webhook data on your webserver. Your application can then enter the data into your CRM (via API), or send an email to the appropriate person, based on the score received (option selected), with the following information.
-
IVR Name
-
Option Selected
- Call UUID
- Source Number
- Destination Number
- Date/Time You can then take appropriate actions from there.
-
-
When you want someone to leave a score, transfer the caller to the virtual extension.
Tip
Use the preview API to download the call recording for the call based on the call UUID and upload it into your CRM or attach it to an email.
Call Flow
Best Practices
- Regularly update Webhook settings to ensure compatibility with third-party services.
- Monitor the performance of Webhooks to ensure they are functioning as expected.