DOCS

<getInput>

This command accepts the caller input (key presses on their device) and transfers it to the provided URL.

To implement IVR and other use cases, it is possible to insert the <playAudio> commands into the <getInput> command.

Pressing a key interrupts the execution of included <playAudio>.

Loops parameter indicates the number of repeated attempts of keys entering if the input was incorrect.

Attribute nameDescriptionDefault value
controller

The URL to which collected data is submitted.

Apifonica will expect to receive a new Apifonica XML file to which flow control will be transferred. In this connection, any commands after the <getInput> command will start executing immideately and stop after new XML is received. If there is no new XML, the current XML will continue to be executed.

The current URL
method

Method to be used to make a request to the specified controller.

POST
timeout

The number of seconds to wait for the caller to press the next key.

If the caller presses one or more keys and then does nothing, the timeout expires and Apifonica submits the input data to the handler URL.

If no keys have been pressed at all and the time is over, Apifonica finishes the <getInput> command and proceeds with the next command.

5
timeoutGeneral

The number of seconds to wait for the caller to press the first button. With <playAudio> included the entire file will be played in case no keys were entered by the user and timeout will be applied afterwards.

5
minSymbols

Minimum number of symbols a user can input that won’t be recognized as incorrect. Value limits are from 1 to 128.

1
maxSymbols

Maximum number of symbols a user can input until this action is considered finished. Values are from 1 to 128.

30
finishOnKey

Input ending symbols. <getInput> command ends after the specified symbol is entered.

#

The following parameters are sent to the controller URL.

ParameterDescription
call_sid
Unique call identifier.
account_sid
Unique account identifier.
from
Caller phone number (conventional or virtual).
to
Recipient’s phone number (conventional or virtual).
status

Call status. Can be completed, in-progress, or failed.

direction

Call direction.

Either inbound or outbound.

input
A combination of keys the caller presses on their device.

REQUEST EXAMPLES

The following example instructs to wait for the input from the user for 6 seconds.

<?xml version="1.0" encoding="UTF-8" ?>
<response>
  <getInput controller="http://myhost.com/getinput.php" timeout="6"></getInput>
</response>

The following example demonstrates the execution of included <playAudio> that is played one time. Controller is expected to receive 2 to 4 symbols. Pressing the ending symbol * <playAudio> is interrupted by <getInput> command.

<?xml version="1.0" encoding="UTF-8" ?>
<response>
  <getInput controller="https://xml.apifonica.com/controller/getinput.php" minSymbols="2" maxSymbols="4" finishOnKey="*">
    <playAudio loops="1">https://xml.apifonica.com/controller/welcome.wav</playAudio>
  </getInput>
</response>