How do I start an Twilio Autopilot chat session without the user needing to greet the bot? - twilio

How can Twilio Autopilot chatbot initiate a session with a user without the user greeting the bot?
I've tried exploring using Twilio Studio to kick off the conversation, but our application requires that the first interaction in the sequence must be a Collection Action. I can't seem to kick off that Collection Action without the user having greeted the bot.
An example would be that every day we would message the user with a question: "How many bananas did you eat today?". The user would then respond and Autopilot would parse the data and send to our system. The question can't be hardcoded in Studio because it will be dynamically generated on a daily basis. The question must be a Collection Action.

Twilio developer evangelist here.
Welcome to StackOverflow!
You can initiate a session with the user without the user greeting the bot by connecting the trigger widget's Rest API trigger event to either a make outgoing call or send message widget, as shown below.
Then, if the call is answered or the message is sent, you can connect those actions to the Send to Autopilot widget.
Lastly, under the config section of your Send to Autopilot widget, put in the Collection task you want to run when the outbound call or message is initiated by your Twilio client and not the user.
Let me know if this helps :D

Related

Get Whatsapp Number of user in Twilio autopilot

I am trying to create a chatbot using Twilio Autopilot which integrated with WhatsApp. So my flow is like, if user messages on registerd number, Twilio WhatsApp senders webhook will get trigger and it will call Autopilot chatbot task. Task will process the data and it will send reply.
In all above flow I want to capture the WhatsApp number of the user who is asking the question. that number I want in autopilot, so Autopilot will send that number to Twilio function and I want to save that number in my Database using external API's call from Twilio function.
How I will get WhatsApp number inside Twilio Autopilot chatbot for user who is asking questions?
Thanks in Advance
Autopilot can respond using static actions defined within the task, but it can also send a webhook request to fetch Actions JSON from your server. That webhook request contains details about the user you are talking with, including the parameter UserIdentifier which, in a WhatsApp chat, will be the user's WhatsApp number.
If you are currently responding to tasks from Actions JSON defined in the Twilio console, you can add a webhook by using a "redirect" action at the end of a set of actions to a URL you control and then responding to that with a "listen" action to wait for the next task. Alternatively, you could just set a URL for the webhook and respond with your Actions JSON from your own app.

Twilio: track user action on SMS links and reply based on that action

I using twilio flow to create simple chatbot that sends user a whatsapp message with link to provide some details and once user has provided the required details on web page, chat bot must reply with a THANKS message.
Is there anything like postback using rest api on active execution based on which a thank you message can sent.
Please have look on diagram as well.
Twilio developer evangelist here.
When you say you are using Twilio flow, I guess you are using Twilio Studio to send the messages. In this case, I don't think you can achieve what you want with Studio. You can't move an execution on with the REST API.
However, it should be fairly straightforward to send the thank you message from your application using the Twilio Messaging API instead.
What you will need to do is, when the user submits the form, in your back-end code as well as saving the data to your database, make a call to the Twilio API to send the WhatsApp message. I'm not sure what your application is built in, so I've just linked to the relevant documentation.

Twilio WhatsApp Autopilot - How to Start The Conversation

Is there any way to make the Autopilot start the conversation. What i need is, I have Customer Mobile Numbers and i need to send to them a automated WhatsApp Message. and based on there inputs, Autopilot response to them.
Thanks,
you should be able to initiate a conversation using one of your WhatsApp approved templates using the Twilio Messages resources. Once the user responds (and the 24 hour free form text opens), you can configure the Webhook for WhatsApp to execute your Autopilot assistant.
Twilio WhatsApp production sender and template creation
Twilio API for WhatsApp *(Send an outbound freeform WhatsApp Message)
WhatsApp - Autopilot Channel
Twilio developer evangelist here.
Welcome to StackOverflow!
You can initiate a session with the user without the user greeting the bot by connecting the trigger widget's Rest API trigger event to either a make outgoing call or, in your case, the send message widget, as shown below.
Then, if the call is answered or the message is sent, you can connect those actions to the Send to Autopilot widget, below.
.
Lastly, under the config section of your Send to Autopilot widget, put in the Collection task you want to run when the outbound call or message is initiated by your Twilio client and not the user.
Let me know if this helps :D

undefined:undefined Twilio Studio Flow SMS Forwarding Function Error

I've been attempting to create a two-way conversation using SMS forwarding in Twilio Studio flow. I know there are multiple ways to set up SMS forwarding in Twilio, and I have been successful in doing so using functions on their own, TwiML and Studio Flow SMS on the send message widget. However, I am struggling with creating a flow that extends beyond one message. I've added the function for SMS forwarding into my flow, but every time a response is received it displays as "undefined:undefined" as opposed to "+15555555555:Hello SMS", Am i missing something?
You might want to use the CHAT product from Twilio instead which would manage all of the sessions, conversations and everything else.

Initiate dialog using Dialogflow, Twilio & Node Js.

I am trying to find a way to trigger a Dialogflow event from Node Js to start a conversation with the end user.
For example, I'd like to send a text message to the end user reminding them about their appointment and ask them for a confirmation.
As I understand it, I would need to initiate the conversation with the end user, and programatically set the entities and context in Dialogflow. Any insights on how I might achieve this?
i.e.
DIALOGFLOW AGENT: Hi John, I'd like to confirm you appointment for 2pm this Thursday?
Dialogflow doesn't currently support proactively sending messages on any platforms. You can send your own messages via the platform's API and any responses to that message will be received by your Dialogflow agent and responded to.

Resources