Use your own app to check if entered number is valid

This the step-by-step scenario that we will create:

  • The IVR will ask the caller to enter a 6 digit reference number.
  • The number and call ID will be sent to an external app.
  • The external app will return a "valid" value or something else to the IVR.
  • If the the reference is valid, then route the caller through queue to an agent.
  • Otherwise offer something else in IVR

First - the data flow from IVR to application and back to IVR

The most important parts are sending the data from the IVR to your app and then how your app puts the data about validity back into the IVR for the particular call. Here is how those parts are done:

Here the IVR module after the number has been captured sends the and the entered number to my external app:


Note that I am using a Zapier webhook URL here in my example to receive the data. You will of course use the URL for whatever API endpoint you have set up to receive your babelforce IVR and call flow data.

Important: Use a "before" position to execute the action to send data to your API and NOT an "after". "before" means that the action is executed on entering the babelforce IVR module (called a "pre-action" on babelforce). With a pre-action you can be sure that if this module starts at all, the action will be fired. A post-action with setting "after" might not fire in certain situations, it is heavily dependent on how the module ends, timing effects on user input, call ending, etc. So always use a pre-action wherever possible.

When this data arrives at my app, it looks like the following. Note that the caller entered "223355" on their phone keypad. And also you need the marked callID. The callID is used to put the data from the external app back into the IVR for the particular call.


Then the external app does a PUT like the following to tell the IVR that the entered number was valid:

Example API request: PUT using Postman

Note that {{env}} below is set to "services" for EU/EMEA, to "us-east" for the US East platform, etc. depending on babelforce platform you are working on:



Example API request: PUT using curl



curl $ENDPOINT \
-H "X-Auth-Access-Id: $ACCESS_ID" \
-H "X-Auth-Access-Token: $TOKEN" \

-d '{ivr.mySection.refnumcheck: 'valid'}'


Second - using the valid result in the IVR to route the call

Create a trigger like the following to test if the result in "refnumcheck" is "valid":


Note, the reason that ivr.mySection.refnumcheck exists here as an expression, is because it is initialized in the first welcome prompt player in the IVR flow, as follows.  


Use that trigger in a Switch Node in IVR. If the trigger is evaluated as TRUE then route the call to the queue flow app which will then handle the finding and ringing of an agent. If it is not TRUE, then in all other cases the call flow will proceed to your alternative treatment in the IVR.

Here is the switch node:


 Third - the IVR call flow that handles the flow

Here is the full set of IVR apps used in the flow:


Here is the full set of audio files used:



Here are the complete settings of the input reader app tab:



IMPORTANT: The input reader must use an After Flow app, i.e. the call flow control must pass to another module and the remainder of the call flow is responsible for checking the actual validity of the digit string that the caller entered.


That's all the main elements that are used for this integrated IVR call flow. Below is just a note and making things a little better in the IVR experience.


Tidying up and making things nicer

Nice noinput and nomatch reprompting and handling will make your flow better and improve the performance, i.e. the % of times that the process successfully captures a valid number when the caller actually had one and wanted to use it.

Here are the way the noinput and nomatch audio file prompts are set. Note that these will be used automatically to handle cases where the user enters nothing on their keypad and also where the IVR receives less than 6 digits or more than 6 digits. Receiving less than expected often happens just because the user things they pressed 6 numbers, but for whatever reason the IVR only gets 5 of them. It makes your flow and the customer experience better if these situations are modeled well.








Have more questions? Submit a request