In this guide, we’ll introduce concepts important to sending SMS messages internationally. These concepts will help you define your use case before you begin building them with Twilio.
If you already have a use case in mind, check the country-specific guidelines for those countries to which you want to send SMS messages with Twilio.
Depending your target country, the content of your SMS message will determine how it is sent. For your use case, determine whether you want to send application-to-person (A2P) or person-to-person (P2P) SMS messages.
Wireless carriers treat A2P and P2P traffic differently, both in terms of the type of content and the volume of traffic allowed. To avoid carrier filtering for your use case, you should know in advance which type of messages you will send.
- A2P messaging is used for one-way SMS messages; the sender does not expect the recipient to reply. Common examples of A2P messaging are marketing messages, 2-factor authentication (2FA), and appointment reminders.
- P2P messaging is used by two or more people to communicate back and forth. Common examples of P2P messaging include customer service messages, texting with a rideshare driver, or communicating with a food delivery courier about the status of an order.
The characters and length of your message determine the number of message segments Twilio sends to the various wireless carriers. Because Twilio bills per message segment, thes factors can affect your pricing.
- GSM-7 is the default SMS encoding standard, which packs the most commonly-used characters into 7 bits. You can find the full GSM-7-character set here. Non-GSM characters include characters such as smart quotes, emoji, and Japanese kanji. There is a limit of 160 characters per message segment encoded with GSM-7.
- UCS-2 is the standard used to represent any non-GSM-7 characters. UCS-2 represents all characters with 2 bytes.
If you include any non-GSM-7 characters in your message body, Twilio will automatically fall back to the UCS-2 encoding, which limits message bodies to 70 characters each.
In concatenated SMS, long SMS messages are sent as smaller messages and recombined upon receipt. This is a common workaround to message character limits.
Twilio splits long SMS messages (>160 GSM characters, >70 UCS-2 characters) into separate SMS message segments and then reassembles them on delivery using user data headers. These headers take 6 bytes per message, leaving 67 characters for UCS-2 encoded messages or 153 for GSM-7 encoded messages.
Note: Not all countries support message concatenation.
To define your use case:
- Use this calculator to determine the encoding and number of segments for your message.
- Determine if the carriers in the countries in which you intend to send SMS support message concatenation.
- Look at SMS pricing for the countries in which you plan to send messages.
- Consider sending SMS messages with a Twilio Messaging Service to take advantage of the SmartEncoding feature.
Only the United States and Canada currently support MMS (Multimedia Messaging Service) messages. However, Twilio's MMS Converter feature (enabled by default) automatically converts MMS to SMS when sent to destinations that don't support MMS. These SMS messages will contain a link in the body to let your recipient access the media.
Each country may have its own specific guidelines and best practices for sending SMS messages, which may affect how your messages arrive and how you should build with Twilio.
For example, France and India limit the times during which you can send promotional or marketing messages, and they require opt-in from message recipients. Carriers in other countries, such as Japan and Saudi Arabia, will filter out gambling-related or objectionable content.
To define your use case:
Country-specific regulations affect whether the sender identity can and should be sent in a certain format. Sender identities vary in throughput capability, type of content that can be sent, and pricing.
In most countries, a long code number is a 10-digit Sender ID used for sending and receiving SMS messages and voice calls.
Good use cases for long codes include P2P and low-throughput communications, such as anonymous chatting applications and customer service communications. <ed. note: I was expecting info on short codes based on this header>
To use phone numbers compliantly around the world, both Twilio and our customers must adhere to local country regulations. This requirement often means you must provide adequate identity documentation to the carriers or local regulators. Failure to do so creates a risk of disruption of service. Check the phone number regulatory guidelines for your countries of interest.
With Twilio you can get long codes on demand for local, national, mobile, and toll-free numbers in 50+ countries. However, these codes have throughput limitations:
- In the United States and Canada, long code numbers are limited to one message/second.
- In the United States and Canada, toll-free numbers are limited to three messages/second.
- In other international countries, numbers are limited to ten messages/second.
If your use case requires higher throughput, you may want to consider short codes instead.
A short code is a 3-6-digit number used for sending SMS and MMS messages. Short codes are pre-approved for high throughput, with a default of 100 messages/second.
Common use cases for short codes include high-volume, time-sensitive A2P messaging, such as notifications, reminders, and marketing communications.
Short codes come with two notable limitations:
- They are currently only available in the US, Canada, and the UK, with an approval process time of eight to 12 weeks.
- They are more expensive than long codes. (See short code pricing information.)
- Determine if a long code fits your use case.
- If necessary, apply for a short code.
- Consider using the Shortcode Reroute feature to prioritize SMS delivery via short code
- Consider using Fallback to Long Code feature as a backup
- Review the regulatory guidelines for phone numbers in the countries in which you intend to send messages.
Alphanumeric Sender IDs contain up to 11 characters for branded one-way messaging. Accepted characters include both upper- and lower-case ASCII letters, the digits 0 through 9, and space: A-Z, a-z, 0-9.
Not all countries support alphanumeric Sender IDs. If you enable an Alphanumeric Sender ID on a Twilio Messaging Service, Twilio will select the Alphanumeric Sender ID automatically when you send a message to a supported country.
To define your use case:
The best way to get started sending international SMS messages is to define your use case in advance. Knowing your use case, country, and throughput needs in advance will help you pick the best Twilio solution for sending global SMS.
Ready to get started? Check the country-specific guidelines and look into using a Twilio Messaging Service for your use case.
誰しもが一度は考える「コーディングって難しい」。そんな時は、お問い合わせフォームから質問してください。 または、Stack Overflow でTwilioタグのついた情報から欲しいものを探してみましょう。