When building an application, there may be scenarios where you want to send SMS messages to your users.
this covers sending an SMS message to a user who is not currently engaged with the bot in the SMS channel.
For instance, if a user calls into your IVR system, you might want to automatically send a verification code for an action they’ve just completed or a confirmation SMS at the end of the interaction.
If you are using Twilio you can leverage the Twilio APIs to trigger an outbound SMS message for a given configured Phone Number in your account.
<aside> 💡
A2P 10DLC registration is required for US messaging. You will need to register the phone number you want to use for this use case and campaign so that you can successfully send messages.
https://console.twilio.com/us1/develop/sms/regulatory-compliance/a2p-10dlc-overview
</aside>
Twilio uses x-www-form-urlencoded calls to send a new outgoing message. For more information, you can visit the Twilio API reference for creating a message resource
In your Zammo application you will want to structure your call as follows:
Send an HTTP request
activityPOST
call to the endpoint: https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/Messages.json
Authorization
and Value as the HTTP Basic Auth for your given Twilio Account SID and Auth Token
application/x-www-form-urlencoded
To=+XXXXXXXXXXX&From=+XXXXXXXXXXX&Body=Thanks for visiting
Your final request should look similar to the following: