Twilio SMS - How to prevent further replies? - twilio

I made a simple chatbot using the studio template and it works fine. However, it then loops after the last response. So let's say I give the user 2 choices, Y and N. After they say Y they get a response but if they message the bot again they get the initial message once again to loop the process. How do I stop this? In the docs I only found info on how to stop all incoming messages but this isn't what I want. I just want to end the convo for good as in my application it has a one time use intention. Thanks.

Twilio developer evangelist here.
There's not really a way to stop incoming texts. What you want to do in this case is stop responding to an incoming text after the initial flow through.
The way to do this would be to use Twilio Functions and function widgets to store the numbers that have successfully completed the questions (you could use any database for this, if you want to keep it within Twilio then Twilio Sync can help here). Then you can insert a function widget at the start of the flow that retrieves whether the number messaging has completed the questions and combine with a split widget to decide whether to send the first message or just complete the flow.
Let me know if that helps at all.

Related

Having trouble using programmable SMS through Zapier & Google Sheets

im new to this form and joined because I use Twilio for my business and had no other place to go for help. Long story short, I sometimes use my Twilio number to send text messages to our customers regarding new products/updates - usually 500 - 1000 messages at a time (over the period of maybe once or twice a month).
Usually how I use Twilio is through ZAPIER, once a contact has a certain tag added from my CRM, I set it so that the tagged contacts will get a text message - it usually works but in May I've tried it several times and it hasn't worked at all.
So I switched to using Google sheets with the script feature of adding my Twilio information and tapping "send sms" on top (Today was the first time I used it). Initially it said all of the messages were sent, but when I checked my Twilio balance - it was relatively the same... so I dug deeper and checked my logs, I realized that all but 3 of the 550 text messages were "delivered" and only those three were received.
It seems like there is some type of issue, as its impossible that only 3 people would open a text message - I usually get a good amount of interest from these blasts.
When I used Zapier this month none of the messages would even get sent, so I'm not sure what's going on.
Has anyone dealt with anything like this? Please share! NOTE: Im a newbie here.

Twilio: Is there a way to export all opt outs?

I want to export everyone who has reply stop (opt out) for my messages. I see that my options are
API. However, through the API I can see that I get everything in pages of 50 messages, so I have to go and do a lot of code to go page by page, message by message just to check if the content is stop. Seems a bit unnecessary for a 1 time job.
From the console in my account, however when each time i try to filter on status received I get the following error, and when I dont filter I get error:
Your export request has more than 10,000 records, please filter your results and try again.
Surely there must be an easy way that I can get all the list of numbers that had opt out?
This answer above is not strictly true as of October 2020. Twilio now has an "insights" dashboard that allows you to view and download "Opt outs Received". When you click on that dashboard you are able to see and download the information.
It is under: Programmable Messaging -> Monitor -> Insights
Our account has "Opt-Out Management" enabled and this addition has been a game changer in finding out what users have or have not done in our system.
There isn't a way to export all opt-outs for LC's/TF's that Twilio maintains on your behalf but opt-outs are forwarded to your application for logging as well as added to the Twilio maintained opt-out list. Your application can keep track of the opt-outs this way. You can find more details in the Help Center article below.
Twilio support for opt-out keywords (SMS STOP filtering)
"When Twilio receives one of these replies, we will create a "blacklist" entry on our side, and then pass the message on to your webhook. Once we have a blacklist entry for a particular recipient phone number, any future attempts to message them will be met with a 400 response from our API, along with Error Code 21610 - Message cannot be sent to the 'To' number because the customer has replied with STOP. Recipients can disable this message stop, and resume receiving messages with the START, YES, or UNSTOP commands as outlined below."
Also, if you use the Twilio helper library for the respective language, it handles the paging for you, for example, for Node.js, reference.
Usage and Migration Guide for Twilio's Node.js Helper Library 3.x
"One of the biggest advantages of twilio-node 3.x is that it automatically handles paging for you! In both list and each, you can specify the maximum number of instances to grab (limit), and the page size (pageSize). The library will take care of everything else."

Twilio Merge Child Recordings

I am trying to build an API which can Onhold both inbound and outbound calls, what I basically do is, update the CallResource and forward it to a Play command when I want to hold on and connect to the agent if I want to resume the call.
This works good, I am able to hold on/ resume call successfully.
I have seen some questions and answers regarding this, Twilio support suggests to use Conference option for that, isn't there may be a new solution (or other solution) for this.
What I want is actually merge child call recordings, isn't there an option for this?
Thanks.
Twilio developer evangelist here.
There is no way to concatenate call recordings within Twilio, what I would recommend is to download the files and concatenate them with something like ffmpeg. You should be able to script this too.

Is it possible to connect flows in Twilio Studio?

I'm trying to link multiple twilio flows together, to make it more manageable and to be able to reuse some specific flow elements just as a payment flow within multiple base flows.
Is it possible to trigger a flow using its webhook url from another flow?
Twilio developer evangelist here.
While technically it is possible to link flows together, in practice it is not ideal right now. You can do so by making a call to another Twilio number that is set to respond with your new flow. As you can imagine, this would confuse your logs and is not straightforward to implement, especially if you want to return link back to the original flow later.
For now, the recommended thing to do is to copy the elements to each flow as you need them.
I've registered that I would like to see us implement subflows that you can reuse like this properly, but for now, copying is likely your best method.

Rails Twilio check National Do Not Call List?

Has anyone ever found and API or anything to check to see if a number is on the national do not call list before placing an automated call using Twilio?
I've been looking around but have been struggling to find an easy way to access the list.

Resources