REST API: Rate Plans(料金プラン)
Rate Planは個々のSIMに関連づけられている機能および制限を表しています。
複数のSIMを同一のRate Planを使用するよう構成することができます。 これは、これらのSIMが同じ機能と制限を継承することを意味します。 しかし、各SIMの使用状況はRate Planに対して独立して計測され、Rate Planで指定された制限は個々のSIMのレベルで計測、適用されます。 たとえば、Rate Planに5MBの場合、このRateの適用された各SIMは5MBのデータ消費が許可されます。
現在、いったん作成されたRate Planの編集は制限されています。 有効化された後にSIMの機能を変更するには、別のRate Planに関連づけし直すことが必要です。
一般的なタスク
HTTPリソースとメソッド
Rate Planインスタンスリソース
リソースURL
https://wireless.twilio.com/v1/RatePlans/{RatePlanSid} https://wireless.twilio.com/v1/RatePlans/{RatePlanUniqueName}
リソースのプロパティ
Rate Planインスタンスリソースは下記のプロパティーによって表現されます:
プロパティ | Type | 概要 |
---|---|---|
sid | 文字列 | このリソースを一意に識別する 34 文字の文字列です。 |
unique_name | 文字列 | このリソースをsid の代わりに一意に識別する、ユーザー提供の文字列です。 |
friendly_name | 文字列 | このリソースを識別するユーザー提供の文字列です。 一意ではありません。 |
data_enabled | boolean | Defines whether SIMs are capable of using GPRS/3G/4G/LTE data connectivity. |
data_limit | integer | Network-enforced limit specifying the total Megabytes of data usage (download and upload combined) allowed during one month on the home network. Metering begins on the day of activation and ends on the same day of the following month. Max value is 2TB. |
data_metering | Enum | The model by which to meter data usage, in accordance with the two available data metering models. Valid options are payg , quota-1 , quota-10 , quota-50 . |
national_roaming_enabled | boolean | SIMが、自国の他のネットワークにローミングできるかどうかを指定します。 「国内」ローミングを参照してください。 |
national_roaming_data_limit | integer | Network-enforced limit specifying the total Megabytes of national roaming data usage (download and upload combined) allowed during one month. Max value is 2TB. |
international_roaming_data_limit | integer | Network-enforced limit specifying the total Megabytes of national roaming data usage (download and upload combined) allowed during one month. Max value is 2TB. |
international_roaming | Enum | Defines whether SIMs are capable of using GPRS/3G/4G/LTE data connectivity and messaging outside of the United States. Acceptable values are data and messaging . |
voice_enabled | boolean | SIMが音声通話の発着信を行えるかどうかを指定します。 |
messaging_enabled | boolean | SIMがCommand経由でSMSの送受信を行えるかどうかを指定します。 |
date_created | DateTime | このリソースの作成された日時で、ISO 8601形式のGMTで取得可能です。 |
date_updated | DateTime | このリソースが最後に更新された日時で、ISO 8601形式のGMTで取得可能です。 |
account_sid | 文字列 | このRate Planの属するアカウントの一意な識別子です。 |
url | 文字列 | このリソースに対するURLです。 |
Explanation of PAYG vs Quota
For low usage devices, the "Pay as you go" (PAYG) Data Metering plan is provided. With PAYG data, you'll only pay for the data you consume, with no minimum data spend per SIM per month.
For higher usage devices, it is probably more cost effective to use a Quota-based Data Metering plan. With a Quota-based plan, you agree to a minimum data spend, or "Quota" level per SIM per month. In return, you will receive discount rates in every country, with more significant discounts for higher Quotas.
Even on a Quota plan, data is still priced per megabyte and metered at byte-level. But at the end of your SIM's billing month, you either pay for exactly what you consumed, or the Quota price, whichever is higher.
See Pricing for more information.
例
一意な名前を使用して、JSON形式で表されるRate Planインスタンスをリクエストします。
HTTP POST
POSTメソッドでRate Planインスタンスリソースの更新を行えます。
オプションパラメーター
下記パラメーターの一部、または全部が提供できます。 リクエストパラメーターがインスタンスリソースのプロパティーに対応する場合、そのプロパティーが与えられた値によって更新されます。
パラメーター | 概要 |
---|---|
UniqueName | このリソースを一意に識別する、Sidの代替としてユーザーが指定した文字列です。 |
FriendlyName | このリソースを識別するユーザー提供の文字列です。 一意ではありません。 |
HTTP PUT
サポートされていません。
HTTP DELETE
DELETEメソッドを使用すると、Rate Planインスタンスリソースを削除できます。
Rate Planは、それに関連づけられたアクティブなSIMがない場合においてのみ削除できる点にご注意ください。
Rate Planの削除に成功すると、APIはHTTP 204 NO CONTENT
レスポンスを返します。
Rate Plansリストリソース
リソース URL
https://wireless.twilio.com/v1/RatePlans
HTTP GET
アカウント内のRate Planの一覧を返します。 一覧にはページング情報が含まれます。
例 1
アカウント内の全Rate Planを一覧します。
HTTP POST
Rate PlanリストリソースにPOSTすることで、Rate Planを新規作成できます。
必須パラメーター
必須パラメーターはありません。
オプションパラメーター
下記パラメーターの一部、または全部が指定できます。 インスタンスリソースのプロパティーに対応するリクエストパラメーターに関しては、プロパティーは指定された値に設定されます。 新規作成されたインスタンスリソースに対する既定値については、下記の表を参照してください。
パラメーター | 概要 | 既定のプロパティー値 |
---|---|---|
UniqueName | このリソースを一意に識別する、Sidの代替としてユーザーが指定した文字列です。 | null |
FriendlyName | このリソースを識別するユーザー提供の文字列です。 一意ではありません。 | null |
DataEnabled | boolean | SIMがGPRS/3G/LTEデータ接続を使用できるかどうかを指定します。 |
DataLimit | integer | Network-enforced limit specifying the total Megabytes of data usage (download and upload combined) allowed during one month on the home network. Metering begins on the day of activation and ends on the same day of the following month. Max value is 2TB. |
DataMetering | Enum | The model by which to meter data usage, in accordance with the two available data metering models. Valid options are payg , quota-1 , quota-10 , quota-50 . |
VoiceEnabled | boolean | SIMが音声通話の発着信を行えるかどうかを指定します。 |
MessagingEnabled | boolean | SIMがCommand、またはProgrammable SMS APIのどちらを経由してSMSメッセージを作成、送信、および受信できるか指定します。 |
NationalRoamingEnabled | boolean | SIMが、自国の他のネットワークにローミングできるかどうかを指定します。 「国内」ローミングを参照してください。 |
NationalRoamingDataLimit | integer | Network-enforced limit specifying the total Megabytes of national roaming data usage (download and upload combined) allowed during one month. Max value is 2TB. If unspecified, the default value is the lesser of DataLimit and 1000MB. |
InternationalRoamingDataLimit | integer | Network-enforced limit specifying the total Megabytes of national roaming data usage (download and upload combined) allowed during one month. Max value is 2TB. If unspecified, the default value is the lesser of DataLimit and 1000MB. |
InternationalRoaming | Enum | Defines whether SIMs are capable of using GPRS/3G/4G/LTE data connectivity and messaging outside of the United States. Acceptable values are data and messaging . |
例
「SmartMeterCA」というUniqueName、「California SmartMeter Plan」というフレンドリー名(分かりやすい名前)、月々5MBのデータ使用量制限、そしてCommandを使用してメッセージング機能がオンにされたRate Planを新規作成します。
国内ローミング
National roaming grants a SIM the ability to roam onto other domestic carrier networks in certain low coverage situations. This will allow a SIM to roam onto regional US networks like GCI in Alaska.
National roaming pricing is different to standard data and Commands pricing. Before enabling national roaming on your Rate Plan, it is recommended to review the pricing.
ヘルプが必要ですか?
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.