Flex Conversations requires Flex UI 2.0.x. If you are on Flex UI 1.x.x, refer to the Messaging in Flex pages.
Flex Conversations currently does not support displaying the customer's WhatsApp Profile Name.
With Flex, your customers can reach you via messaging channels, such as SMS, WhatsApp. The Flex Messaging page in the Console allows you to register Conversations addresses for your channels, so you can process inbound messages using Flex Conversations.
Please refer to the Conversations Webhooks page for more information on event payloads. In the event payload, you can retrieve the ConversationSid
.
Now you can create an interaction and pass the ConversationSid
as the media_channel_sid
:
1// Download the helper library from https://www.twilio.com/docs/node/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID and Auth Token at twilio.com/console5// and set the environment variables. See http://twil.io/secure6const accountSid = process.env.TWILIO_ACCOUNT_SID;7const authToken = process.env.TWILIO_AUTH_TOKEN;8const client = twilio(accountSid, authToken);910async function createInteraction() {11const interaction = await client.flexApi.v1.interaction.create({12channel: {13type: "sms",14initiated_by: "customer",15properties: {16media_channel_sid: "CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",17},18},19routing: {20properties: {21workspace_sid: "WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",22workflow_sid: "WWXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",23task_channel_unique_name: "sms",24attributes: {25from: "+1311-555-2368",26},27},28},29});3031console.log(interaction.sid);32}3334createInteraction();
1{2"sid": "KDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",3"channel": {4"type": "sms",5"sid": "UOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"6},7"routing": {8"reservation": null,9"properties": {10"date_updated": 1634845217,11"task_queue_entered_date": 1634845217,12"workflow_name": "Default Fifo Workflow",13"age_in_queue": 0,14"task_channel_unique_name": "default",15"assignment_status": "pending",16"queue_name": "Sample Queue",17"assignmentCounter": 0,18"priority": 0,19"sid": "WTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",20"workflow_sid": "WWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",21"routing_target": "WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",22"reason": "",23"attributes": "{\"customerAddress\":\"customer phone address\",\"flexChannelInviteSid\":\"KGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"conversationSid\":\"CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"channelType\":\"sms\",\"customers\":{\"phone\":\"customer phone address\",\"name\":\"customer name\"},\"conversations\":{\"initiated_by\":\"customer\",\"conversation_id\":\"KDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"media\":[{\"type\":\"ChatTranscript\",\"sid\":\"CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\"}]},\"customerName\":\"customer name\",\"flexInteractionChannelSid\":\"UOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"initiatedBy\":\"customer\",\"flexInteractionSid\":\"KDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"direction\":\"inbound\"}",24"task_channel_sid": "TCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",25"age": 0,26"workspace_sid": "WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",27"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",28"timeout": 86400,29"date_created": 1634845217,30"addons": "{}",31"queue_sid": "WQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"32}33},34"interaction_context_sid": null,35"url": "https://flex-api.twilio.com/v1/Interactions/KDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",36"links": {37"channels": "https://flex-api.twilio.com/v1/Interactions/KDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels"38}39}
To configure and respond to Flex Conversations messaging tasks, see: