ナンバーズ・リスト

このページでは、所有している Numbers をプログラムでリストアップする方法を紹介します。

自分の Numbers をオンラインで見ることもできます。 開発者ダッシュボード またはコマンドラインから Vonage CLI.

サンプルコードの以下の変数を、独自の値に置き換えてください:

キー説明
VONAGE_API_KEY

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

VONAGE_API_SECRET

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

NUMBER_SEARCH_CRITERIA

The filter criteria. For example, numbers containing 234.

NUMBER_SEARCH_PATTERN

Where the NUMBER_SEARCH_CRITERIA should appear in the number:

  • 0 - At the beginning of the number
  • 1- Anywhere in the number
  • 2 - At the end of the number

Write the code

Add the following to list-numbers.sh:

curl "https://rest.nexmo.com/account/numbers?api_key=$VONAGE_API_KEY&api_secret=$VONAGE_API_SECRET&pattern=$NUMBER_SEARCH_CRITERIA&search_pattern=$NUMBER_SEARCH_PATTERN"

View full source

Run your code

Save this file to your machine and run it:

sh list-numbers.sh

参照