To check the delivery status of an SMS sent via Twilio, you can use the Twilio Console, the Twilio REST API, or a Status Callback Webhook. In the Twilio Console, search for the message using the recipient's number, date, or Message SID to see its status. With the REST API, retrieve the status programmatically using a GET request with the Message SID. For real-time updates, specify a Status Callback URL when sending a message, allowing your server to receive status updates as they occur.
You can get the delivery status of an SMS message sent through Twilio by using one of the following methods:
1. Twilio Console
- Go to the Twilio Console Message Logs.
- Search for the specific message using the recipient’s phone number, date, or Message SID.
- The status (such as sent, delivered, undelivered, or failed) will be displayed in the logs.
2. Twilio REST API
You can retrieve the status programmatically using the Message SID:
curl -X GET "https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/Messages/{MessageSid}.json" \ -u {AccountSid}:{AuthToken}
Look for the status field in the response (e.g., queued, sent, delivered, undelivered, failed).
3. Status Callback Webhook
When sending a message, you can specify a Status Callback URL. Twilio will send HTTP requests to this URL as the message status changes (e.g., sent, delivered, failed).
Example parameter when sending a message:
"status_callback": "https://your-server.com/sms-status"
Your server will receive updates about the message status in real time.
Comments
0 comments
Please sign in to leave a comment.