What is a Webhook?
The Webhooks module enables extensive customization by allowing HTTP requests to external URLs, triggering various actions based on returned data. Whether it's opening a barrier for specific calls, sending emails for customer contacts, or integrating with CRM systems and marketing campaigns, the possibilities are vast. Configure the URL and options to tailor functionalities like call forwarding or database lookups according to your needs.
Be sure to check out Call notifications to maximize the capabilities of your telephone service.
How to create a Webhook?
- Go to Webhooks.
- Click Add.
- Give a name for your Webhook.
- Optionally, provide additional information in the description field. This is not required for the webhook to function.
- Under Caller ID Transmission, choose which number the call recipient will see as the caller ID:
- Caller's number.
- Called number.
- Suppressed (anonymous).
- In the URL Template field, enter the URL that should be triggered upon an incoming call. The help text in the form provides more details. This field specifies how the URL to be called by the webhook should be formatted. Four variables can be used in the URL template:
- {code}: The digit code entered by the caller (see "Using IVR" below).
- {did}: The called number.
- {callerid}: The caller's caller ID.
- {callername}: The caller's name, if available.
A simple example of a URL template could be:
http://webrouting.companyname.com/test.py?code={code}&callerid={callerid}
Use IVR (Interactive Voice Response)
Check this box if you want the caller to enter a digit code to proceed. After selecting this option, five additional fields will appear:
- Timeout: Enter the number of seconds the caller has to input their digit code.
- Number of attempts: Enter the number of times the caller can try to enter the digit code correctly.
- Start message: Select the Sound to be played when the caller is directed to this webhook.
- Error message: Select the Sound to be played if the caller enters an incorrect digit code.
- Timeout message: Select the Sound to be played if the timeout period is exceeded.
- Click Save.
If everything is set up correctly, a link will now be established between your telephony platform and your script, CRM package, Zapier, or other program. You just need to activate this Webhook in your dial plan.
Setting up Webhooks in the dial plan
- Go to Dial Plans.
- Click on the phone number where you want to use the webhook.
- Click on Edit Dial Plan.
- Click Add Step at the location where you want to insert the webhook.
- You will see two sub-steps:
- HTTP and IVR success: These sub-steps are executed if the webhook returns the correct values (the URL is connected) and the caller has potentially entered a valid IVR option.
- HTTP or IVR failure: These sub-steps are executed if there is an issue, such as the caller making an invalid choice or if the URL is not working, possibly due to a server problem.
What to include in your Webhook
You can integrate various elements into your webhook just as you would in your dial plan. Below are some options and their uses:
Caller Name Variable
The caller name—the name that the recipient sees on their screen—can be adjusted in three ways:
- Webhook: Set the caller name to the value returned by the webhook.
- Prefix: Enter text in the routing step that will be prefixed to the caller's name.
- Replace: Enter text in the routing step that will replace the caller's name entirely.
Note: Variable caller name can also be used outside the webhook. In that case, only the options Prepend and Replace can be used.
Variable destination
If the webhook provides a destination, you can forward the call to this destination by selecting "Variable destination" in the routing step (under the webhook section).
Feedback you can provide to the system
Provide the following feedback to indicate the status of the webhook interaction.
Status
- ACK: Input is good.
- NAK: Input is not valid.
- ERR: An error occured.
Destination
Used for forwarding to another destination.
Caller Name
Use this if you want to display the caller's name or the status of the call (such as IVR choice) on a VoIP device.
Feedback interpretation
status=ACK
The request was successfully received and processed with valid input.
status=ACK&destination=%2B31502102544
The request was successfully processed, and the call should be forwarded to the destination number +31 50 210 2544.
status=ACK&destination=215
The request was successfully processed, and the call should be forwarded to the destination number 215.
status=ACK&callername=VoIPGRID
The request was successfully processed, and the caller's name should be set to "VoIPGRID."
Exploring alternative uses for the Webhook
CRM integratie
When a call comes in, we send a pulse to the CRM system. This pulse includes the caller’s number (if known) and the number that was dialed. The CRM then returns the name that should be displayed, and we show that name on the screen of the VoIP phone.
Optionally, the CRM can also open a customer profile based on the incoming call — but that logic needs to be handled within the CRM itself.
Switching based on an external database
We can forward incoming calls to a phone number returned by an external system. This can be based on:
- The caller's number
- The called number
- An entered PIN code
Tracking phone calls in Google Analytics
To track phone calls, you need a block of numbers. Assign a unique number to each campaign. With a block of 10 numbers, you can track up to 10 campaigns simultaneously.
When a customer calls one of the numbers in the block, we send a URL containing the called number (representing the campaign) and the caller's number (if available). Note that our system does not process JavaScript or similar scripts, so a piece of code must be executed after the URL is called to properly measure the conversion.
After the URL is called, we forward the call to the company's main number, and the campaign is tracked.
Receive email for missed calls
When a call is missed, it can be helpful to receive the caller's phone number in an email, SMS message, or via Slack, for example, that includes date, time, and called number. See Webhooks examples for a detailed example via a Zapier connection with webhooks.
VIP pincode
You can use a webhook to assign a specific VIP PIN code to customers, such as for a dedicated support line. For details on how to set this up, visit the VIP PIN Code page.
Connecting to 300+ other web applications via Zapier
You can seamlessly connect your webhook to Zapier, similar to IFTTT (If This Then That). Zapier allows you to integrate various systems, so an action in one web service can trigger actions in others, creating a chain reaction. Zapier supports integration with services like Slack, Gmail, Google Calendar, Zendesk, Mailchimp, Evernote, Dropbox, and many others.
FAQ
Webhooks are triggered at a specific point in the dial plan and only work for incoming calls. If needed, a different URL can be used for each webhook set up. A webhook is called at a single point in time.
Call notifications work for both incoming and outgoing calls. For more details, check out:
With call notifications, the URL can be hit at five different points in the call lifecycle.
- For webhooks, use a GET request.
- For call notifications, use a POST request.