現在の口座残高を確認する

APIリクエストを行い、レスポンスでアカウントの残高を受け取ることで、いつでもVonageアカウントの残高を確認することができます。

キー説明
VONAGE_API_KEY

Your Vonage API key (see it on your dashboard).

VONAGE_API_SECRET

Your Vonage API secret (also available on your dashboard).

Write the code

Add the following to account-balance.sh:

curl "https://rest.nexmo.com/account/get-balance" -u "$VONAGE_API_KEY:$VONAGE_API_SECRET"

View full source

Run your code

Save this file to your machine and run it:

bash account-balance.sh

この例では、口座の現在の残高をユーロで出力します。