Pricing: Voice Resource
The Pricing Voice resource provides a simple API to pull real-time, account-specific pricing for Twilio's Programmable Voice product.
Prices can be retrieved at a country level via the Pricing Voice Countries resource or for a specific phone number via the Pricing Voice Numbers resource.
You may also wish to check out our Pricing API resources for Twilio's Messaging and Phone Number products.
Looking for details on pricing for Twilio products? Check out Twilio's pricing page.
ベースURL
リファレンスドキュメントの URL はすべて、次のベース URL を使用しています。
https://pricing.twilio.com/v2
認証
REST APIへのHTTPリクエストはHTTPベーシック認証により保護されます。Twilioをどのように認証を利用するかはこちらのセキュリティドキュメントをご確認ください。つまり、HTTPベーシック認証では Twilio AccountSIDはユーザー名、AuthTokenはパスワードとして扱われます。
curl -G https://pricing.twilio.com/v2/Voice/Countries/US \ -u '[YOUR ACCOUNT SID]:[YOUR AUTH TOKEN]'
AccountSid と AuthToken はダッシュボードで確認できます。
Pricing Voice Country Instance Resource
This resource represents prices to make voice calls to phone numbers in a given country, organized by phone number prefix (OutboundPrefixPriceWithOrigin), and the prices to receive voice calls on Twilio phone numbers in this country, organized by phone number type (InboundCallPrices).
リソース URL
https://pricing.twilio.com/v2/Voice/Countries/{Country}
{Country} は、ISO 3166-1 alpha-2 フォーマットの国コードです。
リソースのプロパティ
Pricing Voice Country リソースには、次のプロパティがあります。
Names in REST API format | |
---|---|
country
|
The name of the country. |
iso_country
|
The ISO country code. |
url
|
The absolute URL of the resource. |
OutboundPrefixPrices record
プロパティ | 概要 |
---|---|
DestinationPrefixes | Set of destination phone number prefixes for the requested country with the same pricing |
OriginationPrefixes | Set of origination phone number prefixes for the requested country with the same pricing. Valid set elements include specific prefixes, ALL (representing the entire set of all valid prefixes), or ROW (representing the rest-of-world, which is the set of remaining prefixes that aren't specifically listed) |
FriendlyName | この一連のプレフィックスを説明するテキストです。 |
BasePrice | このプレフィックスリストに一致する番号に通話を発信する 1 分あたりの小売料金です。 |
CurrentPrice | このプレフィックスリストに一致する番号に通話を発信する現在の 1 分あたりの料金(数量割引またはカスタム割引の適用対象)です。 |
InboundCallPrice record
プロパティ | 概要 |
---|---|
NumberType | 電話番号タイプです(local 、mobile 、national 、または toll free のいずれか)。 |
BasePrice | この電話番号タイプへの通話を受信する 1 分あたりの小売料金です。 |
CurrentPrice | この電話番号タイプへの通話を受信する現在の 1 分あたりの料金(数量割引またはカスタム割引の適用対象)です。 |
例
Pricing Voice Country List Resource
リソース URL
https://pricing.twilio.com/v2/Voice/Countries
HTTP GET
Twilio 音声サービスが提供されている国のリストおよび国固有の音声料金を取得するための URL を返します。このリストはページ情報を含みます。
例
Twilio 音声サービスが提供されている国のリストを取得します。
Pricing Voice Number Instance Resource
This resource represents the prices to make voice calls to a given phone number (OutboundCallPriceWithOrigin) and the prices to receive voice calls to this Twilio phone number (InboundCallPrice).
リソース URL
https://pricing.twilio.com/v2/Voice/Numbers/{Phone Number}
{Phone Number} は、E.164 フォーマットの電話番号です。
リソースのプロパティ
Names in REST API format | |
---|---|
destination_number
|
The destination phone number in E.164 format, which consists of a + followed by the country code and subscriber number. |
origination_number
|
The origination phone number in [E.164 format, which consists of a + followed by the country code and subscriber number. |
country
|
The name of the country. |
iso_country
|
|
outbound_call_prices
|
The list of OutboundCallPriceWithOrigin records. |
inbound_call_price
|
The InboundCallPrice record. |
price_unit
|
The currency in which prices are measured, specified in ISO 4127 format (e.g. |
url
|
The absolute URL of the resource. |
outboundCallPrices record
プロパティ | 概要 |
---|---|
BasePrice | この番号に通話を発信する 1 分あたりの小売料金です。 |
CurrentPrice | この番号に通話を発信する現在の 1 分あたりの料金(数量割引またはカスタム割引の適用対象)です。 |
OriginationPrefixes | Set of origination phone number prefixes for the requested country with the same pricing. Valid set elements include specific prefixes, ALL (representing the entire set of all valid prefixes), or ROW (representing the rest-of-world, which is the set of remaining prefixes that aren't specifically listed) |
例
電話番号 +15108675310
への音声通話の料金を取得します。
Resource URL by Origination Number
https://pricing.twilio.com/v2/Voice/Numbers/{Destination Number}?OriginationNumber={Origination Number}
Filter by Origination Number Example
Retrieve voice prices for phone number +15108675310
where the Origination Number is +12421234567
.
ヘルプが必要ですか?
誰しもが一度は考える「コーディングって難しい」。そんな時は、お問い合わせフォームから質問してください。 または、Stack Overflow でTwilioタグのついた情報から欲しいものを探してみましょう。