Why did the person I sent an SMS to get duplicate messages?
The best way to start troubleshooting issues of duplicate message delivery is review your SMS logs. Each SMS that Twilio sends out is matched to a record in your logs, identified by a 34-character string starting with “SM” (known as the SMS “SID”). Check to see whether the 2 (or more) messages that the user received came from just 1 SMS record in your Twilio account, or if there are 2 or more SMS records.
If you have a lot of messages in your account, you can view the Twilio SMS Logs with our API Explorer:
- Enter the phone number which the messages were sent to and press “Make Request”.
- An XML or JSON file listing the messages sent to that number will appear.
You are going to be looking for a record for message in question, as well as other messages which are duplicates and which were sent within a few seconds of each other.
If you find one message
This indicates that Twilio sent just one SMS message to the carrier. If your user received more than one, that means there was a duplicate with the recipient carrier, or with an intermediate party between the recipient carrier and Twilio.
Users of all types of phones do at times receive duplicate messages. It is typically the result of a safeguard carriers implement when they think there may have been a service disruption. Duplicate messages should be a rare occurrence, and if you see this happening for an extended period of time to several different recipient carriers, please let us know by collecting the SMS records of the messages that got duplicated and contacting support.
If you find duplicate messages sent within a few seconds of each other
This means that Twilio sent multiple SMS messages to the carrier, and almost always means that Twilio received multiple
POST requests from your app.
If you do see that duplicate SMS messages were sent by Twilio, there may be a bug in your code that is making multiple
POST requests to Twilio. Please check the HTTP request logs on your server as this may reveal more information about the requests sent to Twilio and will be a good place to begin investigating a possible bug.
Instances where Twilio’s system has created a duplicate message without receiving a
POST request from your application are extremely rare, but if you have checked your server logs and are positive that you only see a single request to Twilio, please tell us. It would be very helpful to our troubleshooting if you can send the SIDs of the duplicate messages to us via our “Talk to support” form.