Send Outbound Messages via SMS and WhatsApp
Flex Conversations requires Flex UI 2.0. If you are on Flex UI 1.x, please refer to Messaging in Flex pages.
Flex Conversations currently does not support displaying the customer's WhatsApp Profile Name.
You can use the
/Interactions endpoint to implement additional opportunities for agents to send an outbound SMS, WhatsApp, Chat, or Email.
Some practical examples include a “click-to-sms” or “click-to-email” functionality in your CRM integration.
|Parameters in REST API format|
The Interaction's channel.
The Interaction's routing logic.
On your outbound request, you must set the
initiated_by property to "agent". Also, there are specific field requirements depending on your channel type. See Interactions resource request parameters for the different properties you can set.
Please note, creating outbound WhatsApp interactions is very similar to outbound SMS. However, you will need to create outbound templates in order for an agent to initiate contact.
Once your interaction is created, grab the conversation SID (prefixed by CH) and pass it as a parameter when you create a conversation message.
curl -X POST https://conversations.twilio.com/v1/Conversations/CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Messages \ --data-urlencode "Author=agentname" \ --data-urlencode "Body=Hello world" \ -u $TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN
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 by visiting Twilio's Stack Overflow Collective or browsing the Twilio tag on Stack Overflow.