既存の通知サブスクリプションのリスト

このコードスニペットは、WhatsApp ビジネスアカウントに変更を加えるために、既存の全てのサブスクリプションのリストを取得する方法を示しています。

各コード・スニペットで使用されているすべての変数の説明を以下に示します:

キー説明
VONAGE_API_KEY

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

VONAGE_API_SECRET

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

Prerequisites

If you do not have an application you can create one. Make sure you also configure your webhooks.

Write the code

Add the following to get-notification-webhooks.sh:

curl -u "${VONAGE_API_KEY}:${VONAGE_API_SECRET}" https://api.nexmo.com/v2/whatsapp-manager/subscriptions

View full source

Run your code

Save this file to your machine and run it:

bash get-notification-webhooks.sh

試してみる

コードを実行すると、既存のすべての通知サブスクリプションのリストが表示されます。