Level up your Twilio API skills in TwilioQuest, an educational game for Mac, Windows, and Linux. Download Now

Menu

Expand
Rate this page:

Thanks for rating this page!

We are always striving to improve our documentation quality, and your feedback is valuable to us. How could this documentation serve you better?

Send Message

Send Message Widget

Description:

Send Message allows you to send a message to a user. Use this Widget to send messages to the user before any other action. If you want to request a user’s input after a message, use the Send & Wait For Reply Widget instead.

Required Configuration

Name

Description

Default

Message Body

The text of the message to send.

Send Message From

The “from” number -- choose one from Phone Number, MessagingServiceSid, OTT Id

Flow Default flow.channel.address

Send Message To

The "to" number, or recipient of the message

Flow Default contact.channel.address

Optional Configuration

Name

Description

Default

Media URL

The URL of the media you wish you send out with the message (i.e. https://demo.twilio.com/owl.png)

Programmable Chat Service

Only applies for Flows working with Twilio Programmable Chat. A Chat service is where all the Channels, Messages, Users and other resources within a Chat deployment live. See the Chat Services REST API docs for more information.

trigger.message.InstanceSid

Programmable Chat Channel

Only applies for Flows working with Twilio Programmable Chat. Channels are the center of all chat activity within a Chat Service. Chat messages are sent to a particular channel. See the Chat Channels REST API docs for more information.

trigger.message.ChannelSid

Message Attributes

Only applies for Flows working with Twilio Programmable Chat. An optional string metadata field you can use to store any data you wish along with the sent message. The string value must contain structurally valid JSON if specified. See the Chat Mesages REST API docs for more information.

Using Programmable Chat:

Messages from a user in a Programmable Chat Channel can be received by Studio and responded to using the Send Message widget. To enable incoming Chat messages, add the Studio Flow's webhook URL as a Chat Channel webhook.

Example:

curl -X POST https://chat.twilio.com/v2/Services/ISxxxxxxxx/Channels/CHxxxxxxxxxx/Webhooks \
--data-urlencode "Type=studio" \
--data-urlencode "Configuration.FlowSid=FWxxxxxxxxx" \
-u ACCOUNT_SID:AUTH_TOKEN

New messages posted in the Chat Channel will create a new Studio Execution, enabling the Studio Flow to interact with the Chat user.

Variables:

Outbound

SID widgets.MY_WIDGET_NAME.outbound.Sid
To widgets.MY_WIDGET_NAME.outbound.To
From widgets.MY_WIDGET_NAME.outbound.From
Body widgets.MY_WIDGET_NAME.outbound.Body
Status widgets.MY_WIDGET_NAME.outbound.Status

Rate this page:

Need some help?

We all do sometimes; code is hard. Get help now from our support team, or lean on the wisdom of the crowd browsing the Twilio tag on Stack Overflow.