machinesvilla.blogg.se

Twilio chatbot
Twilio chatbot










Twilo functions are a fairly new serverless environment that you can program in JavaScript.

twilio chatbot

Wow! Serverless really is easy! The Checkout Function This will pipe our flow to execute a Twilio function that we have setup. We’ll use a new widget for this, the Run Function. If we do get a size, then it is time for the checkout magic to happen. Tell me your size, either "medium", "small" or "large". If the message does not have a specified size in it, we can send a response that asks for more clarity with another Send & Wait For Reply Widget: I was actually looking for a hat size. In this case we will use three “ Contains” transition looking for the words small, medium, or large in the message. This widget gives us quite a few conditional operators to use on the customer’s message body such as equal to, contains, or even a regex. To do some basic conditional evaluation of the message, we can use the Split Based On… widget. If we do get a response, either from the follow up, or from the first message, we need to figure out if the customer actually ordered a hat, or if they responded with something random. If they don’t respond to that, then I’ll assume they’re no longer interested - we can end the flow.If your memories are leaking out of your head, you might want to buy two! If I don’t get a response, perhaps my customer was distracted, so I’ll send out another message after a delay asking them to confirm their size.If the message fails, I’ll assume that there is something fishy going on & just end the flow.

twilio chatbot

There are three possible outcomes from sending a message and waiting for a response: getting a reply, not getting a reply, and the message failing. Connected to my Incoming Message trigger, this widget will send my customer: Hey, I hope you are looking for an Awesome Hat! Would you like a small, medium, or large hat? I’ll do this with one of the pre-made Send & Wait For Reply widget. Sending the welcome MessageĪfter the customer messages the number, it is time for the sales pitch! Tristan’s Awesome Hats only sells one kind of hat, but in the welcome message I’ll ask a basic question confirming the the size for the order. This is how my customers will enter a conversation with the bot: by texting the number I have attached to this flow. Each flow has a trigger - in this case, it will be receiving an incoming SMS message. Individual projects in Twilio Studio are called Flows.

twilio chatbot

SMS’s will go through the flow, but voice calls and HTTP requests will fail by design. It’s a good choice because much of the send and receive logic can be handled with the studio flow directly and not require as much development time. Twilio just so happened to release a new product in beta that could be a perfect fit for this use-case: Twilio Studio, a visual tool that utilizes many of the other messaging and telephony services that Twilio offers, but streamlines the setup and configuration. I chose SMS for this project because it is one of the most pervasive forms of communication both in the US and around the world, but it should be pretty easy to port over into any other transactional messaging platform as well. We sell three sizes of hats (small, medium, & large) and I advertise my chatbot number, (479)-888–5188, on my fictional website: this blog post. From there, they can select an item and get a link to a checkout page to complete the purchase.įor this, we’ll build out an example chatbot to help people order fake hats from my fictional store Tristan’s Awesome Hats. When a customer messages the number, they’ll receive a scripted message with the different products they can buy. Our initial goal is an online store that advertises a number that you can text to finish up your shopping. Let’s create a basic conversation-based purchasing experience over SMS that you can use as a template for your own message based buying experience. New tools make chatbots achievable for even the smallest developer, so anyone can leverage this to provide unique buying and ordering experiences. But this isn’t something only for multi-billion dollar tech companies.

twilio chatbot

Try it out! Text (479)-888–5188 to talk to the bot 📲įrom voice commands to chatbots, consumers are engaging with (and buying) things in totally new ways.












Twilio chatbot