Twilio webhook backup solutions - twilio

I want to implement a Twilio webhook to receive sms responses for my initial sms message. However, instead of implementing the secondary "failover" webhook URL, is there a way to call a Twilio REST service to find out which webhook callback from Twilio to my service failed so my application can retrieve the failed message from the failed webhook call?
Thanks.

Twilio developer evangelist here.
I definitely recommend implementing a fallback webhook so that you can at least record failures and know whether to call this other service.
However, you can call the Twilio Monitor API to find out about Alerts. This is a service that will give you information on all webhooks and REST API calls that your application has made that failed or produced a warning of some sort.
Let me know if that helps at all.

Related

How to check status of a Twilio client before connecting call

I am using Twilio client to call my customer or receive the call from customers.
I want to play a busy voice message to customer if the Twilio client is engaged and talking to any other customer. how can I achieve that.
Twilio developer evangelist here.
You can’t tell the status of a Twilio Client from outside the page it is live on. Instead it is best to manage the availability of your agents via TaskRouter. With TaskRouter incoming calls can be queued until there is an available agent to answer. Those calls can also timeout, be assigned to other queues or be redirected to leave messages as in a voicemail system.
I recommend you look into TaskRouter.

Twilio not sending webhooks in Progammable Chat

I would like to ask a question or maybe report a bug after solving my doubts. I started working with Programmable Chat and Twilio do not want to send a webhook to specific url but only when I'm sending message from my PHP code. I downloaded example node app and sending message from that, everything is working really nice, I'm getting post request from Twilio but if only I will send message from PHP, nothing at all. And strange is, after sending message from PHP, it will appear immediately in chat which means that it's working.
How does it possible? Could it mean that Twilio on theirs backend has an a bug when they receive message from PHP and becuase of that they are not fire webhook event?
I eliminated all differences, everything is that same beside that one message is sending from PHP and another from node. Same situation from API Explorer.
Gif presentation
Twilio developer evangelist here.
When you send messages to Programmable Chat from the REST API then webhooks aren't triggered. I think the reasoning is because you are making the call from your server, then your server is already aware that you are sending a message and you don't need to receive a webhook to do so. It also saves from the potential of infinite loops (if your webhook sends a message via the REST API, the requests would just go in circles).
So, it's not a bug, but a design choice. If you need to trigger your webhooks when you send a message from the REST API, you will need to make the webhook from your own server.

Twilio - Messaging Service Inbound Setting to Twilio Function instead of Webhook

I have a phone number that I configured the inbound messaging to run a Twilio function sends the message to the AWS SQS service.
But due to outbound traffic and other limitations, I setup a Messaging Service and I'm using the Passthrough API for bulk outbound. But for the inbound configurations for the Messaging Service, we are only limited to dumping the message, executing a webhook, or starting a conversation. I don't have the ability to run a Twilio function.
If I go back to the phone number configuration I can't have it both ways... it's either the Function or the Messaging Service.
Is there a way I can run a Twilio function on inbound messages to the Messaging Service or do I need to do this all in the webhook?
Twilio developer evangelist here.
When you choose Function in the inbound configuration for a number, it is just setting up the number to point to the Function's webhook URL.
So, you can enter the Function URL as the webhook URL for your messaging service and you shouldn't need to change anything else.

twilio stop receiving messages

We are using twilio service to send messages to our customers. We want to provide STOP receiving messages option to our customers.
So when a customer replies STOP, he/she should stop receiving messages. I think twilio has a blacklist to stop sending messages to a customer if the customers chooses to.
However, as an organization, we also want to know if a customer opted out of receiving messages.
How will twilio tell us that a customer opted out of receiving messages? How can we add a web hook such as a rest endpoint in twilio? Is this usecase possible in twilio?
Twilio evangelist here.
This article explains our default keyword handling: https://support.twilio.com/hc/en-us/articles/223134027-Twilio-support-for-opt-out-keywords-SMS-STOP-filtering-
tl;dr If someone texts STOP to your Twilio number we add them to our blacklist then pass the message on to you via the normal webhook process.
Hope that helps.

How do I receive a Twilio SMS into a Logic App?

How do I create a Logic App to receive an SMS?
I made some progress in my question here
I have been studying the information I found here
and have configured the Twilio Webhook to Call the Http endpoint when a message comes in.
following instructions similar to this
I copied the Request Body JSON from the instructions.
If I the Add A Twilo -Get Message Action it asks for the Unique SID of the message. I can't know this at Logic App Design Time, so how do I get it?
Instead letting Logic App to "retrieve" the message from Twilio, as mentioned in the comments, you should set up a webhook in Twilio's settings page to invoke Logic App ('s request trigger).

Resources