SMS の送信
SMS を送信するには、以下の例の次の変数を置き換えます。
| キー | 説明 |
|---|---|
TO_NUMBER | E.164 format での SMS の送信先番号。例: 447700900000。 |
NEXMO_API_KEY | アカウント概要でご確認ください |
NEXMO_API_SECRET | アカウント概要でご確認ください |
Run your code
Save this file to your machine and run it:
Prerequisites
Create a file named send.js and add the following code:
Run your code
Save this file to your machine and run it:
Prerequisites
Add the following to build.gradle:
implementation 'com.vonage:server-sdk-kotlin:2.1.1'Create a class named SendMessage and add the following code to the main method:
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:
apply plugin: 'application'
mainClassName = project.hasProperty('main') ? project.getProperty('main') : ''Run the following gradle command to execute your application, replacing com.vonage.quickstart.kt.sms with the package containing SendMessage:
Prerequisites
Add the following to build.gradle:
implementation 'com.vonage:server-sdk:9.3.1'Create a class named SendMessage and add the following code to the main method:
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:
apply plugin: 'application'
mainClassName = project.hasProperty('main') ? project.getProperty('main') : ''Run the following gradle command to execute your application, replacing com.vonage.quickstart.sms with the package containing SendMessage:
Prerequisites
Create a file named SendSms.cs and add the following code:
Add the following to SendSms.cs:
Prerequisites
Create a file named send-sms.php and add the following code:
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 send.rb and add the following code:
Run your code
Save this file to your machine and run it:
試行手順
上記例を実行すると、指定した携帯電話番号にテキストメッセージが送信されます。