Matching replies using sms on twillio - twilio

I want to have a flow where I text a user, and that user can text back to trigger an event. I could have multiple outstanding messages to a user at any one time - is there anyway on receiving a text message I can figure out which message it is in reply to, without including an id number in the text message body?

Twilio evangelist here.
So, just to be clear about the problem, it sounds like you have multiple steps in your workflow that might happen in parallel, or at least before the user can response, rather than in a specific linear message/response workflow. Your app might send out 5 messages, and you want to match up each of 5 replies to a specific message.
If thats the case, then unfortunately there really isn't a direct way built into Twilio to let you match up a message reply without including some kind of ID or command in the response message.
Hope that helps.

Related

Associating a Twilio number with a specific Frontline user

I'm trying to figure out how to associate a specific user with a Twilio number, so that when a call/text comes to that number it only goes to that user's Frontline app/account.
I'm writing the callbacks in Node.js, and I guess that I'm a bit confused to as to how to identify the target number (as the quickstart I'm using is more focused on the customerNumber and relationship with a specific worker).
Thank you.
I believe you should set up Custom Routing for this and, instead of using the customer number (the MessageBinding.Address from the webhook parameters) to do the routing as in the quick start, you can use the number the customer sent the message to, which I think is the MessageBinding.ProxyAddress.
Check out all the parameters that are sent to the onConversationRoute webhook URL. You might also want to test and just log out all the available parameters in order to match to the target number.
The best and the only option I see the Call Forwarding for that purpose and using Twilio's inbuilt TwiML Bins.
Complete info:
https://support.twilio.com/hc/en-us/articles/223179908-Setting-Up-Call-Forwarding

Any way to setup Alerts for Twilio SMS messages by excluding a group of errors, rather than by including each error specifically?

I am working on a project that encounters a series of errors everyday such as user unsubscribed, etc. (About 4 or 5 different error codes everyday)
These errors are inconsequential to the management and can be ignored.
Any way to configure the alerts on Twilio to email me when any error occurs which DOES NOT belong to the error group that is deemed inconsequential?
Doesn't have to be email, new to this and open to any savvy ways of keeping myself informed of new errors in an automated way.
As far as I can tell, I can only perform the opposite action(Setup 1 alert for each error code) on the Twilio code. This has the disadvantage of having to know the error code in advance before configuring the alert.
Open to any way of doing this, not just through the console(via a Python API etc.)
Thank you.
Twilio developer evangelist here.
Can I suggest that you set up the event webhook as shown here:
It will send a webhook event to a server of yours for every error or warning that is triggered. You could then build a small service that receives those errors and discards the ones you don't care about and alerts you of ones that do matter.
On top of that, you can change the threshold of the error emails. If you always get 4-5 errors a day, making the alert threshold 6 errors may alert you if something is wrong that you don't expect.
Finally, the errors may be inconsequential, but you might find it easier to try to drive those errors to 0 every day anyway. If they are due to unsubscribed phone numbers, ensure to disable sending messages to those numbers once you detect that they are unsubscribed.

Twilio- using webhook to a second phone number to dialogue with customer

I'm using Twilio Studio and have two phone numbers.
I want to start a text conversation (A) with the customer and after a certain event (like keyword "manager") occurs, I want to alert a second text conversation (B) from a new phone number with that same customer.
I was thinking it might work to forward a message from (A) to (B), but I'm not sure how to give B the phone number that (A) was texting.
First off, I'm a newbie so take what I say with a grain of salt...
I'm almost positive there are 3 or 4 tutorials that you can link together to solve your issue. I think I've read/watched all of them 4x in the last 3 days trying to self learn.
To be honest, from what I've gathered in my self teachings your answers lie within their YouTube channel and their help docs on Functions, Webhooks, HTTP Requests and maybe even TwiML Redirects. But again, I'm a new guy.
If someone who is more knowledgeable doesn't respond back then I'll try to help you because I think I can if you can bear with me. Just reply with a tag so I'll get an alert. Good Luck (to us both!)
you can retrieve the phone number of the customer by referencing off any text you sent/received from the costumer in the flow.
For instance a if you texted them it would be {{widgets.your_widgets_name_here.outbound.To}}
Then just type in this syntax {{widgets.your_widgets_name_here.outbound.To}} in the message body of the widget you are using to alert conversation (B).
It will display the Number of the costumer.
You could then put that in the send message field of any widget in that conversation by refrencing the same way {{widgets.your_widgets_name_here.inbound.body}}

Changing messages on Slack

So I'm attempting to change a message in slack through my slackbot at the end of a chain of events. I'm able to change it for the first few instances, but I'm not able to do the very last one. I'm 99% sure that it is because I have reached the 5 interactions limit since I am indeed going through 5 interactions with the user prior to my final message. If this is the case, is there a way to change a message without server responses? I ask because the last message is simply a thank you message to the user for participating. It doesn't actually require any input from data on the server to accomplish. I feel like I read about doing it somewhere, but for the life of me I cannot find it again. Any help or links would be greatly appreciated!
EDIT: The user is interacting with buttons through interactive messages to respond to some questions. The current method of updating messages are with chat.update and setting "response_type": "ephemeral" within the json params that I am sending.
An alternative method to using chat.update is to simply reply with the message to the request from Slack. This will replace the existing message by default. It has no limit that I am aware of, so it solves your problem.
This works great with slash commands and interactive messages.
See here for more details.

Twillio: Automatic stop after first sms response

Hi I have an automated system setup for twillio. When ever anyone texts our number we automatically respond with a thank you text. However we would like that text to be the only text that goes out. Currently if someone texts the number again responding to our thank you text, they get the same text response back. Since it's setup to trigger with any incoming sms text message. Does anyone know how to set this to just STOP after the first sms response on our part?
Its not really a twilio issue, but for every text you receive, you need to store the number in a database of some sort, and do a lookup against that table to check if a reply should be sent.
You won't be able to do this with just twiml, you'll need to add a bit of custom code in the language of your choice.
You can get the number as
from_number = request.POST.get('From', '')
and save it every number to which you send message in database.
Filter the table with number before an sms is being sent from your end.
if not from_number_exists in table:
send sms

Resources