Skip to main content

Sms

The Sms action allows sending SMS messages to the specified phone number from the bot script.

You will need an SMS package to send messages from the script. Contact bd@tovie.ai if you want to purchase one.

tip
If you want to send SMS messages using JavaScript code snippets rather than action tags, use replies with the sms type in $response.replies instead.

Parameters

ParameterTypeDescriptionRequired
textStringMessage text.
Follow the message length restrictions.
Yes
destinationStringRecipient phone number without the leading plus sign.Yes
providerConfigurationArray of objectsProvider configuration.
Specify this parameter if you have set up an integration with the Vonage provider. Otherwise, NXSMS will be displayed as the SMS sender.
No
okStateStringThe state the dialog will switch to if the tag script finishes without errors.No
errorStateStringThe state the dialog will switch to if the tag script fails: for example, if you haven’t purchased an SMS package.No

How to use

state: Confirmation
Sms:
text = Your order has been successfully completed.
destination = 16123456789
providerConfiguration =
{
"type": "VONAGE",
"from": "Tovie AI",
"apiKey": "aaa012",
"apiSecret": "abc123456789",
"typeEncoding": "unicode"
}
okState = /Confirmation/Success
errorState = /Confirmation/Failure

state: Success
a: Thanks for your order! We have sent your order details in an SMS message.

state: Failure
a: Sorry, SMS delivery failed.