メニュー

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?

Proxyクイックスタート

With just a few lines of code, you can have a text and/or voice conversations between two cloaked participants.

このクイックスタートでは、下記のことを学んでいきます:

  1. Twilio電話番号を購入する
  2. アカウント情報を収集する
  3. Set up your development environment
  4. Create a Proxy service
  5. Serviceに電話番号を追加する
  6. セッションを作成する
  7. Participants (参加者) を追加する
  8. SMSを送信
  9. 音声通話を発信する

To test this quickstart, make sure you have two phone numbers you wish to connect ready to go (perhaps two cell phones?).

I'm ready to do this!

Twilio電話番号を購入する

The first thing you need in order to set up a proxied session is a Twilio-powered phone number. You can grab one to use in the console here.

Make sure that it has SMS and/or Voice enabled for the purposes of this quickstart. Note that in many countries, numbers will only have either Voice or SMS capability; to test both features you will need both types in your number pool. US and Canadian numbers will have both capabilities.

Notify SMSクイックスタート - Twilio電話番号の購入

Take a note of the Twilio string identifier (SID) of the number. You'll need it for this quickstart; here's where you find the Phone Number SID:

電話番号ID

Proxy Poolには、最低2つの電話番号を用意されることをお勧めします。

Got my numbers! What's next?

アカウント情報を収集する

You can find these in the Twilio Console.

  • アカウントSID - REST APIリクエストの認証に使用します
  • Auth Token - Used to authenticate REST API requests

コンソール内のTwilioアカウントサマリーセクション

For all of our code snippets and curl examples, you will need to authenticate with the Account SID and Auth Token.

OK, account credentials are in hand...

Set up your development environment

The next steps will involve writing some code. We've provided examples in multiple languages, but you will need a working development environment in at least one of them. Here are some guides we've written to help you get your Twilio development environment up and running:

We also provide examples for the curl command line which should work from a Linux or macOS terminal.

I'm ready to write some code...

サービスを作成する

Note: You can also create Services via the console for Proxy.
Let's create a service that will contain our sessions:

        
        
        
        

        Take a note of the service SID (KSxxxx) that you get as a response.

        OK, Service is created!

        Serviceに電話番号を追加する

        We need to associate the number(s) we bought with our newly created service. The phone numbers you add will be added to the anonymous number pool for your proxied communications.

              
              
              
              

              This adds a single number to the Proxy pool. Repeat for each of your Twilio phone numbers

              Phone number(s) have been added!

              セッションを作成する

              A session is a conversation between two people. This code will create a new session in your Proxy service.

                    
                    
                    
                    

                    Note the session SID (KCxxxx) from the response you get.

                    OK, I've got a session, now what?

                    Participants (参加者) を追加する

                    You can't have a good conversation without participants, so let's add some.

                          
                          
                          
                          

                          2人目のParticipant (もう一人分のプロクシーされるユーザー用の別の電話番号と)「わかりやすい名前」) を使用して再度実行します。

                          各Participantに対して、Participantに割り当てられた電話番号を伴ったレスポンスを受信します。 この電話番号は、先に追加した電話番号Poolから選択されたものです。 電話番号の機能に応じて、会話中にテキストメッセージを送信するか、音声通話を発信します。

                          Let's have a conversation!

                          SMSを送信

                          電話番号にテキストメッセージングの機能がある場合、この先に進む準備は万端です! 音声通話Proxyについては、次の節までお進みください。

                          Let's send a message from one of the assigned Proxy numbers to one of the participants. Execute the following for one of the participants (the participant you'd like to receive this initial message):

                                
                                
                                
                                

                                これで、Proxyのテキスト対話を継続できます!

                                Voice conversations too?

                                音声通話を発信する

                                If your Twilio Phone Numbers are voice capable, you're now ready for a proxied voice conversation. Following the names from the previous steps, get Alice to make a call to her Proxy Identifier number. Twilio's Proxy service will then make a call from Bob's Proxy Number to his real number and connect the two calls.

                                Now you're talking anonymously!

                                You now know how to create text and/or voice conversations between two masked participants. To learn more about how Proxy works check out the guide to Phone Number Management or dive into the REST API reference.

                                Rate this page:

                                ヘルプが必要ですか?

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