GetMultipleChoice

Get a spoken response from a fixed set of possible values.

Properties

Property Type Description
Required Properties
choices list[string] List of possible values to listen for. The user must say one of the entries in this list for the command to finish.
on_done string Callback URL to be sent an HTTP POST request when finished. See Get multiple choice callback for details.
Optional Properties
timeout_seconds integer Time, in seconds, to wait for the user to say one of the choices. When the timeout expires, will send an empty string to the on_done callback and move on to the next command in the routine.
prompt_url string URL of the .wav or .mp3 file to play at the start of the command. Normally used to communicate instructions to the end user.

Example

{
    "name": "GetMultipleChoice",
    "on_done": "http://myserver.com/gotorder",
    "timeout_seconds": 25,
    "prompt_url": "http://myserver.com/choose_option.wav",
    "choices": ["cheeseburger", "hamburger", "salad"]
}

Get multiple choice callback

HTTP request sent when a GetMultipleChoice command finishes.

Request

method:POST
content-type:application/json

The request body contains a JSON object with the following properties:

Property Type Description
account_id string The ID of your Sift API account.
connection_id string ID of the Connection that handled the command.
choice string The phrase that was spoken by the end user. Will be equal to one of the strings provided in the choices property of the GetMultipleChoice command or the empty string if none of the choices was heard.

Example

{
    "account_id": "372718353dcf4d16",
    "connection_id": "6f5704748865267a",
    "choice": "cheeseburger"
}

Response

content-type:application/json

The response body may optionally contain a JSON object with the following properties.

Property Type Description
Optional Properties
routine list A new routine list to run on the connection referenced by the connection_id property of the request.