ユーザーの削除
このコードスニペットでは、ユーザを削除する方法を説明します。
例
以下の変数が、便利な方法で必要な値に設定されていることを確認してください:
| キー | 説明 |
|---|---|
USER_ID | The unique ID of the User. |
Prerequisites
You will need to use an existing Application and have a User in order to be able to delete a User. See the Create Conversation code snippet for information on how to create an Application. See also the Create User code snippet on how to create a User.
Write the code
Add the following to delete-user.sh:
curl -X "DELETE" "https://api.nexmo.com/v1/users/$USER_ID" \
-H 'Authorization: Bearer '$JWT\
-H 'Content-Type: application/json'Run your code
Save this file to your machine and run it:
Prerequisites
You will need to use an existing Application and have a User in order to be able to delete a User. See the Create Conversation code snippet for information on how to create an Application. See also the Create User code snippet on how to create a User.
npm install @vonage/server-sdkCreate a file named delete-user.js and add the following code:
Run your code
Save this file to your machine and run it:
Prerequisites
You will need to use an existing Application and have a User in order to be able to delete a User. See the Create Conversation code snippet for information on how to create an Application. See also the Create User code snippet on how to create a User.
Add the following to build.gradle:
Create a class named DeleteUser and add the following code to the main method:
Run your code
We can use the アプリケーション 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.users with the package containing DeleteUser:
Prerequisites
You will need to use an existing Application and have a User in order to be able to delete a User. See the Create Conversation code snippet for information on how to create an Application. See also the Create User code snippet on how to create a User.
Add the following to build.gradle:
Create a class named DeleteUser and add the following code to the main method:
Run your code
We can use the アプリケーション 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.users with the package containing DeleteUser:
Prerequisites
You will need to use an existing Application and have a User in order to be able to delete a User. See the Create Conversation code snippet for information on how to create an Application. See also the Create User code snippet on how to create a User.
Install-Package VonageCreate a file named DeleteUser.cs and add the following code:
Add the following to DeleteUser.cs:
Prerequisites
You will need to use an existing Application and have a User in order to be able to delete a User. See the Create Conversation code snippet for information on how to create an Application. See also the Create User code snippet on how to create a User.
pip install vonage python-dotenvRun your code
Save this file to your machine and run it:
試してみる
コードを実行すると、指定したユーザが削除されます。