サブアカウントを取得する
このコード・スニペットでは、Subaccountの詳細を取得する方法を説明します。
例
以下の変数が、便利な方法で必要な値に設定されていることを確認してください:
| キー | 説明 |
|---|---|
VONAGE_API_KEY | 親アカウントのAPIキー。 |
VONAGE_API_SECRET | 親アカウントのAPIシークレット。 |
SUBACCOUNT_KEY | 詳細を取得したいSubaccountのAPIキー。 |
Run your code
Save this file to your machine and run it:
Prerequisites
Create a file named get-subaccount.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:
Create a class named GetSubaccount 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.subaccounts with the package containing GetSubaccount:
Prerequisites
Add the following to build.gradle:
Create a class named GetSubaccount 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.subaccounts with the package containing GetSubaccount:
Prerequisites
Create a file named GetSubAccountRequest.cs and add the following code:
Add the following to GetSubAccountRequest.cs:
Prerequisites
Create a file named get-subaccount.php and add the following code:
Run your code
Save this file to your machine and run it:
Prerequisites
Write the code
Add the following to get-subaccount.py:
from vonage import Auth, Vonage
from vonage_subaccounts import Subaccount
client = Vonage(Auth(api_key=VONAGE_API_KEY, api_secret=VONAGE_API_SECRET))
subaccount: Subaccount = client.subaccounts.get_subaccount(SUBACCOUNT_KEY)
print(subaccount)Run your code
Save this file to your machine and run it:
Prerequisites
Create a file named find-subaccount.rb and add the following code:
Run your code
Save this file to your machine and run it:
試してみる
コードを実行すると、指定したSubaccountの詳細が取得されます。