Studio uses Widgets to represent various parts of Twilio's functionality that can then be stitched together in your Studio Flow to build out robust applications that require no coding on your part.
New to Twilio Studio? Check out our Getting Started Guide!
The Send Message Widget allows you to send an SMS or chat message to a user from your Studio Flow.
_10curl -X POST https://chat.twilio.com/v2/Services/ISxxxxxxxx/Channels/CHxxxxxxxxxx/Webhooks \_10--data-urlencode "Type=studio" \_10--data-urlencode "Configuration.FlowSid=FWxxxxxxxxx" \_10-u ACCOUNT_SID:AUTH_TOKEN
Once you've configured your Chat Service to use your Flow to handle messages, new messages posted in the Chat Channel will create a new Studio Execution, allowing your Studio Flow to interact with a Chat user.
These events trigger transitions from this Widget to another Widget in your Flow. For more information on working with Studio transitions, see this guide.
Name | Description |
---|---|
Sent | The message was successfully delivered to the recipient. |
Failed to Send | The request to the Messaging API failed and the message could not be sent. |
Each outbound message you send with Send Message will store the following variables for use throughout the rest of your Studio Flow. For more information on working with variables in Studio, see this guide.
Find definitions and examples for these variables at the Message Resource page.
Name | Liquid Template Language |
---|---|
Body | {{widgets.MY_WIDGET_NAME.outbound.Body}} |
From | {{widgets.MY_WIDGET_NAME.outbound.From}} |
SID | {{widgets.MY_WIDGET_NAME.outbound.Sid}} |
Status | {{widgets.MY_WIDGET_NAME.outbound.Status}} |
To | {{widgets.MY_WIDGET_NAME.outbound.To}} |
The following example shows a Studio Flow that will send a message with the contents "Hello!" whenever a user messages the phone number connected to the Studio Flow.