SMS の受信
SMS を受信する要件は以下のとおりです。
- メッセージを受信する仮想番号をレンタルします
- 以下のサンプルコードのいずれかを使って Web フックエンドポイントを作成します
- Nexmo Dashboard で Web フックを設定します
Prerequisites
Run your code
Save this file to your machine and run it:
Prerequisites
Add the following to build.gradle:
Run your code
We can use the application plugin for Gradle to simplify the running of our application. Update your build.gradle with the following:
Run the following gradle command to execute your application, replacing com.vonage.quickstart.kt.sms with the package containing ReceiveMessage:
Prerequisites
Add the following to build.gradle:
Run your code
We can use the application plugin for Gradle to simplify the running of our application. Update your build.gradle with the following:
Run the following gradle command to execute your application, replacing com.vonage.quickstart.sms with the package containing ReceiveSMS:
Prerequisites
Create a file named SmsController.cs and add the following code:
Prerequisites
Create a file named index.php and add the following code:
Add the following to index.php:
Run your code
Save this file to your machine and run it:
Prerequisites
Run your code
Save this file to your machine and run it:
Prerequisites
Create a file named receive.rb and add the following code:
Run your code
Save this file to your machine and run it:
Nexmo Dashboard で Web フックエンドポイントを設定します
Nexmo が Web フックにアクセスできるようにするには、Nexmo アカウントでアクセス方法を設定する必要があります。
Web フックはコードスニペットの /webhooks/inbound-sms にあります。Ngrok を使用している場合、Nexmo Dashboard の API 設定ページで設定が必要な Web フックは「https://demo.ngrok.io/webhooks/inbound-sms」フォームを取ります。「demo」部分を Ngrok から提供されるサブドメインに置き換えて、 着信メッセージ用 Web フックの URL というラベルが付いたフィールドにエンドポイントを入力します。

試行手順
上記準備を完了して Nexmo の番号を SMS に送信すると、その番号はコンソールに記録されるようになります。メッセージオブジェクトには次のプロパティが含まれます。