メニュー

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?

Sim Resource

A Sim resource represents a physical SIM that can connect to a wireless network.

To avoid ambiguity throughout this page, Sim (initial cap) refers to the Sim API resource. SIM (all caps) refers to the physical Subscriber Identity Module (that is, a SIM card) associated with a Sim resource.

A Sim resource must have a RatePlan before it can become active. The RatePlan describes the capabilities and restrictions that apply to the SIM.

非同期のリソース

The Sim resource performs Asynchronous Operations. To receive an asynchronous notification when a Sim resource has finished updating, provide a callback URL, and optionally a callback method, parameter with your initial HTTP Request. This is demonstrated in an example below.

Sim properties

Names in REST API format
sid
sid<DE> Not PII

The unique string that we created to identify the Sim resource.

unique_name
文字列 PII MTL: 30 DAYS

An application-defined string that uniquely identifies the resource. It can be used in place of the resource's sid in the URL to address the resource.

account_sid
sid<AC> Not PII

The SID of the Account to which the Sim resource belongs.

rate_plan_sid
sid<WP> Not PII

The SID of the RatePlan resource to which the Sim resource is assigned.

friendly_name
文字列 PII MTL: 30 DAYS

The string that you assigned to describe the Sim resource.

iccid
文字列 PII MTL: 30 DAYS

SIMに関連づけられているICCIDです。

e_id
文字列 Not PII

Deprecated.

status
enum:status Not PII

The status of the Sim resource. Can be: new, ready, active, deactivated, canceled, deleted, scheduled, or updating. See Status Values for the description of each status.

reset_status
enum:reset_status Not PII

The connectivity reset status of the SIM. Can be: null or resetting. When a connectivity reset is initiated on a SIM, this property is resetting. After the reset completes, it is null.

commands_callback_url
url Not PII

The URL we call using the commands_callback_method when the SIM originates a machine-to-machine Command. Your server should respond with an HTTP status code in the 200 range; any response body will be ignored.

commands_callback_method
http_method Not PII

The HTTP method we use to call commands_callback_url. Can be: POST or GET. Default is POST.

sms_fallback_method
http_method Not PII

The HTTP method we use to call sms_fallback_url. Can be: GET or POST. Default is POST.

sms_fallback_url
url Not PII

The URL we call using the sms_fallback_method when an error occurs while retrieving or executing the TwiML requested from the sms_url.

sms_method
http_method Not PII

The HTTP method we use to call sms_url. Can be: GET or POST. Default is POST.

sms_url
url Not PII

The URL we call using the sms_method when the SIM-connected device sends an SMS message that is not a Command.

voice_fallback_method
http_method Not PII

The HTTP method we use to call voice_fallback_url. Can be: GET or POST. Default is POST.

voice_fallback_url
url Not PII

The URL we call using the voice_fallback_method when an error occurs while retrieving or executing the TwiML requested from voice_url.

voice_method
http_method Not PII

The HTTP method we use to call voice_url. Can be: GET or POST. Default is POST.

voice_url
url Not PII

The URL we call using the voice_method when the SIM-connected device makes a voice call.

date_created
date_time<iso8601> Not PII

The date and time in GMT when the resource was created specified in ISO 8601 format.

date_updated
date_time<iso8601> Not PII

The date and time in GMT when the Sim resource was last updated specified in ISO 8601 format.

url
url Not PII

The absolute URL of the resource.

links
uri_map Not PII

The URLs of related subresources.

ip_address
文字列 Not PII

Deprecated.

ステータス値

下記の表では、Simインスタンスで使用できるstatusの値を説明しています。

Status 概要
new

The Sim is waiting to be activated so that it can join the network. A Sim can exist in new status indefinitely at no charge, but once it is transitioned to ready or active, it cannot be returned to new.

ready

Simはネットワークに接続でき、Rate Plan(料金プラン)に応じたネットワークリソースが使用可能ですが、月額料金は発生しません

Once the SIM has consumed 250KB of data or three months have passed, the Sim will transition automatically to active status. On the fifth Command sent to_sim or from_sim, the device will automatically transition to the active status.

Use the ready status when shipping your device to a customer if you aren't exactly sure when they'll start using it.

Note: This is not available for the Narrowband developer plan.

active Simはネットワークに接続でき、Rate Plan(料金プラン)に応じたネットワークリソースが使用可能です。
suspended The Sim is blocked from connecting to the network. After three months of suspension at no charge, a suspended monthly fee will be initiated. See Suspended SIM Fees on Programmable Wireless Pricing.
deactivated The Sim is blocked from connecting to the network. After 72 hours, the Sim will transition automatically to the terminal status canceled. Use this status when you never want the Sim to reconnect (for example, if it has been lost or stolen).
canceled Terminal status. The Sim is blocked from connecting to the network and can no longer be reactivated.
scheduled 上流のネットワーク事業者は一時的にSIMのステータスを更新できません。 上流のネットワーク事業者がトランザクションの受け入れを再開すると、Simは要求されたステータスに自動的に更新されます。
updating Simに非同期での更新が行われています。 Simの更新中は、一部の項目を変更できない可能性があります。 このような場合、409 Conflictレスポンスを返します。

Fetch a Sim resource

GET
https://wireless.twilio.com/v1/Sims/{Sid}

The {Sid} parameter can be the SID or the UniqueName of the Sim resource to fetch.

パラメーター
Names in REST API format
sid
Path
GET sid_like<DE> Not PII

The SID or the unique_name of the Sim resource to fetch.

例 1
        
        
        
        
        Fetch a Sim resource by using its SID

        Fetch a Sim resource

        Fetch a Sim resource by using its SID
        例 2
              
              
              
              
              Fetch a Sim resource by using its UniqueName

              Fetch a Sim using its UniqueName

              Fetch a Sim resource by using its UniqueName

              Read multiple Sim resources

              GET
              https://wireless.twilio.com/v1/Sims

              アカウント中のSimの一覧を返します。 一覧にはページング情報が含まれます。

              パラメーター
              Names in REST API format
              status
              オプション
              GET enum:status Not PII

              Only return Sim resources with this status.

              iccid
              オプション
              GET 文字列 PII MTL: 30 DAYS

              Only return Sim resources with this ICCID. This will return a list with a maximum size of 1.

              rate_plan
              オプション
              GET 文字列 Not PII

              The SID or unique name of a RatePlan resource. Only return Sim resources assigned to this RatePlan resource.

              e_id
              オプション
              GET 文字列 Not PII

              Deprecated.

              sim_registration_code
              オプション
              GET 文字列 Not PII

              Only return Sim resources with this registration code. This will return a list with a maximum size of 1.

              例 1
                    
                    
                    
                    
                    Return a list of Sims within an account, including paging information

                    Read multiple Sim resources

                    Return a list of Sims within an account, including paging information

                    Update a Sim resource

                    post
                    https://wireless.twilio.com/v1/Sims/{Sid}

                    The {Sid} parameter can be the SID or the UniqueName of the Sim resource to update.

                    パラメーター
                    Names in REST API format
                    sid
                    Path
                    post sid_like<DE> Not PII

                    The SID or the unique_name of the Sim resource to update.

                    unique_name
                    オプション
                    post 文字列 PII MTL: 30 DAYS

                    An application-defined string that uniquely identifies the resource. It can be used in place of the sid in the URL path to address the resource.

                    callback_method
                    オプション
                    post http_method Not PII

                    The HTTP method we should use to call callback_url. Can be: POST or GET. The default is POST.

                    callback_url
                    オプション
                    post url Not PII

                    The URL we should call using the callback_url when the SIM has finished updating. When the SIM transitions from new to ready or from any status to deactivated, we call this URL when the status changes to an intermediate status (ready or deactivated) and again when the status changes to its final status (active or canceled).

                    friendly_name
                    オプション
                    post 文字列 PII MTL: 30 DAYS

                    A descriptive string that you create to describe the Sim resource. It does not need to be unique.

                    rate_plan
                    オプション
                    post sid_like<WP> Not PII

                    The SID or unique name of the RatePlan resource to which the Sim resource should be assigned.

                    status
                    オプション
                    post enum:status Not PII

                    The new status of the Sim resource. Can be: ready, active, suspended, or deactivated.

                    commands_callback_method
                    オプション
                    post http_method Not PII

                    The HTTP method we should use to call commands_callback_url. Can be: POST or GET. The default is POST.

                    commands_callback_url
                    オプション
                    post url Not PII

                    The URL we should call using the commands_callback_method when the SIM sends a Command. Your server should respond with an HTTP status code in the 200 range; any response body is ignored.

                    sms_fallback_method
                    オプション
                    post http_method Not PII

                    The HTTP method we should use to call sms_fallback_url. Can be: GET or POST. Default is POST.

                    sms_fallback_url
                    オプション
                    post url Not PII

                    The URL we should call using the sms_fallback_method when an error occurs while retrieving or executing the TwiML requested from sms_url.

                    sms_method
                    オプション
                    post http_method Not PII

                    The HTTP method we should use to call sms_url. Can be: GET or POST. Default is POST.

                    sms_url
                    オプション
                    post url Not PII

                    The URL we should call using the sms_method when the SIM-connected device sends an SMS message that is not a Command.

                    voice_fallback_method
                    オプション
                    post http_method Not PII

                    The HTTP method we should use to call voice_fallback_url. Can be: GET or POST.

                    voice_fallback_url
                    オプション
                    post url Not PII

                    The URL we should call using the voice_fallback_method when an error occurs while retrieving or executing the TwiML requested from voice_url.

                    voice_method
                    オプション
                    post http_method Not PII

                    The HTTP method we should use when we call voice_url. Can be: GET or POST.

                    voice_url
                    オプション
                    post url Not PII

                    The URL we should call using the voice_method when the SIM-connected device makes a voice call.

                    reset_status
                    オプション
                    post ienum:reset_status Not PII

                    Initiate a connectivity reset on the SIM. Set to resetting to initiate a connectivity reset on the SIM. No other value is valid.

                    account_sid
                    オプション
                    post sid_like<AC> Not PII

                    The SID of the Account to which the Sim resource should belong. The Account SID can only be that of the requesting Account or that of a Subaccount of the requesting Account. Only valid when the Sim resource's status is new. For more information, see the Move SIMs between Subaccounts documentation.

                    例 1
                          
                          
                          
                          
                          Update a Sim, providing a callback URL and callback method

                          Update a Sim resource

                          Update a Sim, providing a callback URL and callback method

                          コールバック値

                          コールバックURLがリクエストに含まれる場合、下記のパラメーターを含む非同期リクエストがそのURLに発行されます。

                          パラメーター 概要
                          SimSid このコールバックの参照元のSimです。
                          SimUniqueName 存在する場合、そのSimのUniqueName(一意な名前)です。
                          SimStatus Simの新しいステータスを表す更新文字列です。
                          ErrorCode エラーの発生時、エラーコードが提供されます。
                          ErrorMessage エラーの発生時、エラーメッセージが提供されます。
                          ApiVersion 最初のリクエストが発行されたAPIのバージョンです。
                          AccountSid このコマンドの属するアカウントの一意なIDです。

                          コールバックメソッドがPOSTに設定されるか指定されなかった場合、コールバックパラメーターはHTMLフォームパラメーターとして渡されます。 コールバックメソッドがGETであった場合、コールバックパラメーターはクエリー文字列として渡されます。

                          Move SIMs between Subaccounts

                          If you are using Subaccounts, you can transfer new SIMs between your accounts.

                          While using the master account's credentials, use the AccountSid parameter to provide the Account SID of the account you wish to own that SIM. SIMs can be moved between accounts the following ways:

                          • From the master account to a subaccount
                          • From a subaccount to the master account
                          • From a subaccount to another subaccount

                          If the Sim you are moving is assigned to a Rate Plan, you must also pass the SID or unique name of a Rate Plan that belongs to the new account or null in the RatePlan parameter of your Update request.

                          Delete a Sim resource

                          削除する
                          https://wireless.twilio.com/v1/Sims/{Sid}

                          The {Sid} parameter can be the SID or the UniqueName of the Sim resource to delete.

                          パラメーター
                          Names in REST API format
                          sid
                          Path
                          削除する sid_like<DE> Not PII

                          The SID or the unique_name of the Sim resource to delete.

                          例 1
                                
                                
                                
                                

                                View SIM Lifecycle Events

                                The lifecycle events of a Sim are audited and reported by Monitor Events. An update to a Sim resource results in a Monitor Event with an Event Type of wireless-sim.updated.

                                The valid resource_properties that can be reported are rate_plan_sid and status. For each, a previous and updated value may be provided. For example:

                                "event_data": {
                                  "resource_properties": {
                                    "rate_plan_sid": {
                                      "previous": "WP0195dea2f0b1e00dbc54d0715e36e2db",
                                      "updated": "WP3b921b4711ee21ac01c7075a7eb19fcf"
                                    },
                                    "status": {
                                      "previous": "new",
                                      "updated": "active"
                                    }
                                  }
                                }
                                
                                Rate this page:

                                ヘルプが必要ですか?

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