Messaging: Country Pricing Resource
The Messaging Country Pricing resource provides a simple API to pull real-time, account-specific pricing for Twilio's SMS product.
Prices can be retrieved at a country level directly via the Pricing Messaging Countries resource or for a specific phone number by leveraging the Lookup API and Pricing Messaging Countries resource.
You may also wish to check out our Pricing API resources for Twilio's Voice and Phone Number products.
Looking for details on pricing for Twilio products? Check out Twilio's pricing page.
認証
HTTP requests to the REST API are protected with HTTP Basic authentication. To learn more about how Twilio handles authentication, please refer to our security documentation.
In short, you will use your Twilio account SID as the username and your auth token as the password for HTTP Basic authentication.
curl -G https://pricing.twilio.com/v1/Messaging/Countries/US \ -u '[YOUR ACCOUNT SID]:[YOUR AUTH TOKEN]'
AccountSid と AuthToken はダッシュボードで確認できます。
MessagingCountry Pricing properties
Names in PHP format | |
---|---|
country
|
国の名前です。 |
isoCountry
|
|
url
|
|
Fetch a MessagingCountry resource
https://pricing.twilio.com/v1/Messaging/Countries/{IsoCountry}
In the above API call, {IsoCountry} is the ISO 3166-1 alpha-2 format country code.
例 1
The resource Twilio returns represents prices to send SMS messages to phone numbers in a given country, organized by Mobile Country Code (MCC) and Mobile Network Code (MNC), and the prices to receive messages on Twilio phone numbers in this country, organized by phone number type.
A Pricing resource will have the following properties attached based on the type of Price record it is (Outbound SMS, Outbound Price, or Inbound Price):
OutboundSmsPrice record
プロパティ | 概要 |
---|---|
MCC | モバイル国コードです。 |
MNC | モバイルネットワークコードです。 |
キャリアー | この MCC/MNC の組み合わせのキャリアの名前です。 |
Prices | 個々の Twilio 電話番号タイプからこの MCC/MNC に SMS を送信する料金を表す OutboundPrice レコードのリストです。 |
OutboundPrice record
プロパティ | 概要 |
---|---|
NumberType | メッセージを送信する Twilio 電話番号のタイプです(mobile 、local 、shortcode 、または toll free のいずれか)。 |
BasePrice | メッセージを送信する小売料金です。 |
CurrentPrice | メッセージを送信する現在の料金(数量割引またはカスタム割引の適用対象)です。 |
InboundPrice record
プロパティ | 概要 |
---|---|
NumberType | メッセージを受信する Twilio 電話番号のタイプです(mobile 、local 、shortcode 、または toll free のいずれか)。 |
BasePrice | メッセージを受信する小売料金です。 |
CurrentPrice | メッセージを受信する現在の料金(数量割引またはカスタム割引の適用対象)です。 |
Read multiple MessagingCountry resources
https://pricing.twilio.com/v1/Messaging/Countries
Returns a list of countries where Twilio messaging services are available along with the corresponding URL for retrieving the country-specific messaging prices. This list includes paging information.
例 1
ヘルプが必要ですか?
We all do sometimes; code is hard. Get help now from our support team, or lean on the wisdom of the crowd browsing the Twilio tag on Stack Overflow.