Pricing: Phone Numbers Resource
The Pricing Phone Numbers resource provides a simple API to pull real-time, account-specific pricing for Twilio's phone numbers.
Prices can be retrieved at a country level via the Pricing Phone Numbers Countries resource.
You may also wish to check out our Pricing API resources for Twilio's Messaging and Voice products.
Looking for details on pricing for Twilio products? Check out Twilio's pricing page.
ベースURL
リファレンスドキュメントの URL はすべて、次のベース URL を使用しています。
https://pricing.twilio.com/v1
認証
REST APIへのHTTPリクエストはHTTPベーシック認証により保護されます。Twilioをどのように認証を利用するかはこちらのセキュリティドキュメントをご確認ください。つまり、HTTPベーシック認証では Twilio AccountSIDはユーザー名、AuthTokenはパスワードとして扱われます。
curl -G https://pricing.twilio.com/v1/PhoneNumbers/Countries/US \ -u '[YOUR ACCOUNT SID]:[YOUR AUTH TOKEN]'
AccountSid と AuthToken はダッシュボードで確認できます。
Pricing Phone Numbers Country Instance Resource
このリソースは、電話番号タイプ別の特定の国の Twilio 電話番号料金(PhoneNumberPrices)を表します。
リソース URL
https://pricing.twilio.com/v1/PhoneNumbers/Countries/{Country}
{Country} は、ISO 3166-1 alpha-2 フォーマットの国コードです。
Pricing Phone Numbers Country リソースには、次のプロパティがあります。
Resource Properties in REST API format | |
---|---|
country
|
The name of the country. |
iso_country
|
The ISO country code. |
url
|
The absolute URL of the resource. |
Instance Properties in REST API format | |
phone_number_prices
|
The list of PhoneNumberPrice records. |
price_unit
|
The currency in which prices are measured, specified in ISO 4127 format (e.g. |
PhoneNumberPrice record
プロパティ | 概要 |
---|---|
NumberType | 電話番号タイプです(local 、mobile 、national 、または toll free のいずれか)。 |
BasePrice | この Twilio 電話番号タイプの 1 ヶ月あたりの小売料金です。 |
CurrentPrice | この Twilio 電話番号タイプの現在の 1 ヶ月あたりの料金(数量割引またはカスタム割引の適用対象)です。 |
Attention: Countries for which phone numbers are not available for purchase through the API will return the following JSON:
{"url": null, "country": null, "price_unit": null, "phone_number_prices": null, "iso_country": null}
Pricing Phone Numbers Country List Resource
リソース URL
https://pricing.twilio.com/v1/PhoneNumbers/Countries
HTTP GET
Twilio 電話番号がサポートされている国のリストを返します。このリストはページ情報を含みます。
例
Twilio 電話番号がサポートされている国のリストを取得します。
ヘルプが必要ですか?
誰しもが一度は考える「コーディングって難しい」。そんな時は、お問い合わせフォームから質問してください。 または、Stack Overflow でTwilioタグのついた情報から欲しいものを探してみましょう。