Ryan
Ryan

Reputation: 45

Is there a way to know if the message succeeded in the response?

We just started using Twilio and are running into an issue of people attempting to use landlines to send messages. We are thinking of using Twilio's lookup functionality, but wanted to see if there was a way to get a better response after sending the message? Right now all it really tells us is that it's been added to the queue.

Upvotes: 0

Views: 102

Answers (1)

Swimburger
Swimburger

Reputation: 7164

To send a message via Twilio, you're creating a Message Resource via the Twilio API. Message Resources have a status property that indicates whether the message has been sent, delivered, undelivered, failed, etc. You can find the list of Message Resource status's here.

When you first create the Message Resource, it will not have been delivered yet, so if you want to know if a message was delivered successfully, you have to query the Message Resource at a later point.

Alternatively, you can configure the StatusCallback with a webhook URL. Twilio will send HTTP requests to your webhook URL when the status of the Message Resource changes. This way you can keep track of the status as it changes.

Upvotes: 2

Related Questions