You can use the GetDigits element to collect the digits entered by a caller. Once the caller finishes entering the digits, the API submits the data to the provided action
URL using a HTTP GET or POST request.
You can play a message nested inside the GetDigits element while the digits are being received in the background, which is useful for creating an interactive voice response (IVR) tree.
You can nest Speak and Play elements within the GetDigits element.
action stringCallback-retry configurable | The URL to which the digits are sent. See the “Parameters sent to the action URL” table below for more information. Allowed values: a full qualified URL |
method string | Method used to send HTTP request to the action URL. Allowed values: GET, POST |
timeout integer | Time in seconds to wait to receive the first digit. If the user fails to provide input within the timeout period, the next element in the response is processed. Allowed values: any positive integer |
digitTimeout integer | Time in seconds allowed between consecutive digit inputs. If input is not provided within the digitTimeout period, digits entered until then will be processed. Allowed values: any positive integer |
finishOnKey string | A digit that the user can press to submit digits. Allowed values: One and only one of 0–9, *, #, <empty string>, none If set to <empty string> or none, input capture will end based on a timeout or the numDigits attribute. |
numDigits integer | Maximum number of digits to be processed in the current operation. Only the number of numDigits is captured; any additional digits entered are ignored. Allowed values: integer >= 1 |
retries integer | Indicates the number of retries the user is allowed to input digits if digits are not received within the time specified by timeout. Allowed values: integer >= 1 |
redirect boolean | Redirect to action URL if true. If false, request the URL and continue to next element. Allowed values: true, false |
playBeep boolean | Plays a beep when all Speak and Play elements finish executing. Allowed values: true, false |
validDigits string | Specifies the set of digits the user is allowed enter. Allowed values: any digit, #, * |
invalidDigitsSound string | URL of the sound file to be played when the user enters an invalid digit. Allowed values: Any remote sound file URL (MP3 or WAV) |
log boolean | If true, Plivo logs digits entered by the caller, and you can view them in debug logs. If false, logging is disabled during GetDigits element processing. Allowed values: true, false |
These parameters are sent to the action
URL after DTMF input is captured.
Digits | The digits input by the caller, excluding the finishOnKey digit if used. |