ユーザー一覧
このコードスニペットでは、Applications に関連する Users のリストを取得する方法を説明します。
Prerequisites
You will need to use an existing Application containing at least one User in order to see a list of a Users. 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.
Run your code
Save this file to your machine and run it:
Prerequisites
You will need to use an existing Application containing at least one User in order to see a list of a Users. 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.
Create a file named list-users.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 containing at least one User in order to see a list of a Users. 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 ListUsers 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 ListUsers:
Prerequisites
You will need to use an existing Application containing at least one User in order to see a list of a Users. 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 ListUsers and add the following code to the main method:
VonageClient client = VonageClient.builder()
.apiKey(VONAGE_API_KEY)
.apiSecret(VONAGE_API_SECRET)
.build();Write the code
Add the following to the main method of the ListUsers class:
List<BaseUser> users = client.getUsersClient().listUsers();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 ListUsers:
Prerequisites
You will need to use an existing Application containing at least one User in order to see a list of a Users. 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.
Create a file named GetUsers.cs and add the following code:
Add the following to GetUsers.cs:
Prerequisites
You will need to use an existing Application containing at least one User in order to see a list of a Users. 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.
Run your code
Save this file to your machine and run it:
試してみる
コードを実行すると、アプリケーションに関連付けられたユーザのリストが表示されます。