メニュー

Expand
Rate this page:

Thanks for rating this page!

We are always striving to improve our documentation quality, and your feedback is valuable to us. How could this documentation serve you better?

Best Practices for Messaging Services

概要

Twilio Messaging Services automatically solve the most common SMS problems for you. For example, you set the configuration in the Console or by API, and the Service will pick the right phone number to send from and adapt your message content so it can successfully pass through ever-changing carrier specs.

While your Messaging Service takes care of most of the complexity for you, here are a few best practices to keep in mind.

Messaging Service経由ですべてのSMSを送信する

The first Messaging Service best practice is... use a Messaging Service! When sending SMS you can set the From parameter to a specific number or you can simply omit it and set the Messaging Service SID. You need to use a Messaging Service to take advantage of features like Advanced Opt-Out, Sticky Sender, Scaler, Geomatch, Shortcode Reroute, and Smart Encoding. We recommend always using a Messaging Service because it gives you access to these capabilities, along with any new ones we ship, without having to write any additional code.

お役立ちリンク集:

Create and manage Messaging Services in the Console

Create and manage Messaging Services via API

必要になる電話番号の数を計算する

Phone numbers are what you will typically use as the source of your message. Your Messaging Service automatically uses the best possible phone number from a Messaging Service's number inventory when it sends a message. This means you need enough phone numbers to handle all your planned messaging.

There may be limitations for how you use phone numbers depending on the country's limitations. (See our out guide to prepare for sending international SMS.)

For example, in the US and Canada, sending too many messages in a day from the same number puts you at risk of carriers filtering your messages. For application-to-person messaging, marketing traffic, and very high volume messaging, short codes are the way to go and help you avoid US/CA carrier restrictions.

If you plan to use phone numbers (i.e, long codes) there are a few things to consider:

1. What kind of senders (phone numbers) will you need?

Consider what senders and numbers you'll need for your use case. Are you sending one-way only, or do you expect replies? How many messages are you sending? Are you in a country that supports AlphaSender?

For example, you may want to use an AlphaSender in supported countries for one-way SMS.

Determining this information before you add senders to your Messaging Service makes set-up much smoother.

2. どのくらい速くメッセージを送信したいのか?

The rate at which messages are allowed to be sent over a single phone number varies by country. In the US, it’s approximately 1 message/second. Outside of the US, it’s typically 10 messages per second. We’ve built a highly available distributed queue so you don’t have to worry about these limits. Your application can send Twilio API requests as quickly as you’d like. We’ll queue your messages for you, and send them out at the appropriate rate. This keeps your application in compliance but can delay the delivery of your messages.

Adding phone numbers to your Messaging Service can increase your delivery rate. For example, five US phone numbers each sending at approximately one message per second can send about five messages per second together. Bear in mind that these are approximate sending numbers because long code phone numbers don’t have a dedicated throughput. If you need dedicated throughput, you may want to look into using short codes, which can send at rates starting at 100 messages per second.

Message Queue Insightsを使用すると、電話番号を追加するタイミングを決めるのに役立ちます。

ガイドラインは国によって異なります。 メッセージ送信先の特定の国のガイドラインについては、Twilioの国際SMS使用ガイドラインを確認してください。

グローバルなメッセージ配信では国内電話番号の使用を考慮する

In some countries, using a local familiar phone number can improve the read and response rate. You may want to add in-country numbers to your messaging service for each country you want to send SMS to. Your Messaging Service will automatically prioritize Short Codes and Alphanumeric Sender IDs where they are supported. Where they are not supported, the Service will prioritize in-country phone numbers. If no appropriate short code, Slphanumeric Sender ID, or in-country phone number is available, the Service will send from a US long code.

お役立ちリンク集:

アルファニューメリック送信番号のトランザクションサポート

どのキャリアーがTwilioでのショートコードをサポートしますか?

Messaging Serviceを使用して400個未満の電話番号を追加する

The maximum number of phone numbers per messaging service is 400.

If you need to add more than 400 numbers, consider getting a short code. A single short code can send messages at rates starting at 100 messages per second and can go higher. Short codes have the added advantage of carrier pre-approval. This means that they can send much higher volume per day without being subject to filtering in the same way that long code phone numbers are.

ロングコードを追加して、ショートコード(日本国内未対応)使用時においても配信率を改善する

Short codes are broadly supported in the US, Canada, and the UK, but some smaller carriers may not support short code messages. To achieve the highest levels of deliverability you should add a few long codes to your messaging service. In the US and Canada, the Short Code Reroute feature will send from a long code phone number when a short code is not supported.

Short codes can only be used to send domestic traffic (e.g., Canadian short codes can only send SMS in Canada.). In addition to using short codes, you should add long code numbers if you plan to send international SMS.

サポートされている国々において、一方通行のメッセージ配信に英数字の送信者IDの追加を検討する

Alphanumeric Sender ID lets you send branded one-way messages in 150+ countries. The Messaging Service will automatically set the From parameter of your message to either your Alphanumeric Sender ID or a phone number, depending on whether Alpha sender IDs are supported. Before you can use an Alphanumeric Sender ID with your Messaging Service, it must be enabled on your Account's SMS Settings.

アルファニューメリック送信者番号は返信を受信できないことに留意してください。 ユースケースが主に一方通行の場合であっても、ユーザーが返信できるよう、電話番号の使用を(あるファニューメリックの)代わりに使用した方がよいかもしれません。 送信者番号の使用方法については、国によって異なるレギュレーションがあります。 フランスのような一部の国では、いかなるA2P(アプリケーションから人間に送信されるメッセージ = Application to Person)トラフィックはアルファニューメリックで送信することが必要です。 インドのようなまた別の国では、アルファニューメリックの使用には事前登録が必要です。

SMSを送信したい各国については、Twilioの国際SMS使用ガイドライン、およびアルファニューメリック送信者番号の国際サポートの一覧を参照してください。

Rate this page:

ヘルプが必要ですか?

誰しもが一度は考える「コーディングって難しい」。そんな時は、お問い合わせフォームから質問してください。 または、Stack Overflow でTwilioタグのついた情報から欲しいものを探してみましょう。