Skip to contentSkip to navigationSkip to topbar
Rate this page:

Receive Inbound Messages with Flex Conversations Channels


(information)

Info

Flex Conversations requires Flex UI 2.0. If you are on Flex UI 1.x, please refer to Messaging in Flex pages.

(information)

Info

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(link takes you to an external 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:

Create an Interaction

create-an-interaction page anchor
Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_25
// Download the helper library from https://www.twilio.com/docs/node/install
_25
// Find your Account SID and Auth Token at twilio.com/console
_25
// and set the environment variables. See http://twil.io/secure
_25
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_25
const authToken = process.env.TWILIO_AUTH_TOKEN;
_25
const client = require('twilio')(accountSid, authToken);
_25
_25
client.flexApi.v1.interaction
_25
.create({channel: {
_25
type: 'sms',
_25
initiated_by: 'customer',
_25
properties: {
_25
media_channel_sid: 'CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
_25
}
_25
}, routing: {
_25
properties: {
_25
workspace_sid: 'WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
_25
workflow_sid: 'WWXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
_25
task_channel_unique_name: 'sms',
_25
attributes: {
_25
from: '+1311-555-2368'
_25
}
_25
}
_25
}})
_25
.then(interaction => console.log(interaction.sid));

Output

_25
{
_25
"sid": "KDXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_25
"channel": {
_25
"type": "sms",
_25
"initiated_by": "customer",
_25
"properties": {
_25
"media_channel_sid": "CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
_25
}
_25
},
_25
"routing": {
_25
"properties": {
_25
"workspace_sid": "WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_25
"workflow_sid": "WWXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_25
"task_channel_unique_name": "sms",
_25
"attributes": {
_25
"from": "+1311-555-2368"
_25
}
_25
}
_25
},
_25
"interaction_context_sid": null,
_25
"url": "https://flex-api.twilio.com/v1/Interactions/KDXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_25
"links": {
_25
"channels": "https://flex-api.twilio.com/v1/Interactions/KDXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Channels"
_25
}
_25
}

To configure and respond to Flex Conversations messaging tasks, see:


Rate this page: