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.
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 to be used to make a request to the specified controller.
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.
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.
Minimum number of symbols a user can input that won’t be recognized as incorrect. Value limits are from 1 to 128.
Maximum number of symbols a user can input until this action is considered finished. Values are from 1 to 128.
Input ending symbols. <getInput> command ends after the specified symbol is entered.
The following parameters are sent to the controller URL.
Unique call identifier.
Unique account identifier.
Caller phone number (conventional or virtual).
Recipient’s phone number (conventional or virtual).
Call status. Can be completed, in-progress, or failed.
Either inbound or outbound.
A combination of keys the caller presses on their device.
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>