Outbound calls
This guide will walk you through the process of configuring your Voice platform to utilize the FlowBuilder application for initiating outbound phone calls.
Requirements
To initiate outbound calls from FlowBuilder, you will need the following:
- A valid CLI (Caller Line Identification) of a number that you own
- A complete FlowBuilder flow
- A tool to make POST requests to the Voice API
- A valid Voice API key
Note
Before starting this process, ensure you have saved your flow to ensure it's up to date and ready for use.
This guide uses the free Postman tool to make requests to the Voice API. However, any tool capable of making HTTP POST requests will suffice.
Finding your callflow ID
Each callflow created in the Voice FlowBuilder is assigned a unique identifier in UUID format. This callflow ID is used to initiate the outbound call with the correct flow. To find the callflow ID of the flow you want to use, open the FlowBuilder application and click on the desired flow.
On the page that opens, you can find your callflow ID in the following location.
Flow variables
To enable hyper-personalized and customizable outbound calls, we have added the option to pass Flow variables to your flow when initiating an outbound call. To get an overview of all the variables that can be passed in, open the callflow detail page:
All the variables shown in green are variables that are both created and consumed within your flow. The variables shown in blue are variables that are created in your flow but are not used. Finally, the variables shown in yellow are variables that are consumed but not created in your flow. These variables are prime candidates to supply to outbound calls via the Voice API. We will discuss how to supply these variables further down in this article.
Important note
When you supply a variable that is also created within your flow (e.g., dtmf_input in the image above), the value passed via the Voice API will be overwritten during runtime.
Making the request
To make the request, open the Postman application and click on the plus icon to create a new request.
Set the request URL to https://api.cm.com/voiceapi/v2/FlowBuilder
, and ensure the request method is set to POST.
Next, open the Headers tab and add the X-CM-PRODUCTTOKEN
header, with your API key as the value. For more information on where to find your API key, please refer to the Authentication article.
Next, open the Body tab. In the request body, we will supply the required information for the Voice API to create the outbound call. For a detailed description of the parameters in the request body, please refer to the "FlowBuilder Outbound" section in the Voice API documentation.
Ensure your request body type is set to raw and JSON. Paste the JSON value below into Postman, and fill in the callflow-id
and flow-variables
with the data you collected earlier.
{
"callee": "00316xxxxxxxx",
"caller": "003176xxxxxxx",
"callflow-id": "00000000-0000-0000-0000-000000000000",
"flow-variables": {
"firstName": "John",
"lastName": "Doe"
}
}
Once you've verified all the data is correct, you can initiate the outbound call by clicking the Send button. After doing so, you'll receive an HTTP response similar to the following, indicating that the call has been placed successfully. After a few moments, the phone number specified in the callee field should receive the phone call.
Updated 4 months ago