In this Programmable Voice Calling API Quickstart, you'll learn how to handle inbound voice calls using webhooks, Flow Builder, and MessageBird’s Programmable Voice Calling API.
We’ll walk you through the following steps:
To retrieve a Call Flow from a URL (i.e. set up a call webhook), you must use the HTTP
GETmethod in your application.
When a person calls a virtual number assigned to such a URL via Flow Builder, you'll need to make an HTTP request to your application and retrieve the call flow - this will be what the caller hears on the other end of the call.
Since it's a
GET, you'll need to send parameters in the query string.
For most applications, you should only need the
sourcefield - which indicates the phone number that's calling.
Your application should return a call flow encoded as JSON or XML with the appropriate content type, for example,
application/jsonfor a JSON-encoded call flow or application/xml for an XML-encoded call flow.
Here’s an example of an XML-encoded call flow with a single step:
<?xml version="1.0" encoding="UTF-8"?><Say language="en-GB" voice="female">Hello, thanks for calling!</Say>
We recommend that you check the Voice Calling API documentation for a list of available step actions and options.
Now, configure a simple flow using Flow Builder to handle inbound voice calls on a virtual number:
Create new flowand then
Create Custom Flow.
Phone Callthen select the your number or numbers.
Fetch call flow from URL, and paste the same local-tunnel base URL into the form, but this time append
Publishto activate the flow.
Congrats! You can now programmatically handle inbound voice calls using Webhooks, Flow Builder, and the Programmable Voice Calling API.
You may now want to check out these resources: