Create a User
In this code snippet you learn how to create a User.
Example
Ensure the following variables are set to your required values using any convenient method:
| Key | Description |
|---|---|
USER_NAME | The unique name of the User. |
USER_DISPLAY_NAME | The display name of the User. |
Prerequisites
You will need to use an existing Application in order to be able to create a User. See the Create Conversation code snippet for information on how to create an Application.
Run your code
Save this file to your machine and run it:
Prerequisites
You will need to use an existing Application in order to be able to create a User. See the Create Conversation code snippet for information on how to create an Application.
Create a file named create-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 in order to be able to create a User. See the Create Conversation code snippet for information on how to create an Application.
Add the following to build.gradle:
Create a file named CreateUser 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:
Run the following gradle command to execute your application, replacing com.vonage.quickstart.kt.users with the package containing CreateUser:
Prerequisites
You will need to use an existing Application in order to be able to create a User. See the Create Conversation code snippet for information on how to create an Application.
Add the following to build.gradle:
Create a file named CreateUser 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:
Run the following gradle command to execute your application, replacing com.vonage.quickstart.users with the package containing CreateUser:
Prerequisites
You will need to use an existing Application in order to be able to create a User. See the Create Conversation code snippet for information on how to create an Application.
Run your code
Save this file to your machine and run it:
Try it out
When you run the code you will create a new User.