Delete a Subscription
This code snippet shows how to delete an existing subscription for changes to your WhatsApp business account.
Example
Find the description for all variables used in each code snippet below:
| Key | Description |
|---|---|
VONAGE_API_KEY | Your Vonage API key (see it on your dashboard). |
VONAGE_API_SECRET | Your Vonage API secret (also available on your dashboard). |
CHANNEL_MANAGER_WHATSAPP_NOTIFICATION_WEBHOOK_ID | Unique ID of the subscription. |
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 delete-notification-webhook.sh:
curl -X DELETE https://api.nexmo.com/v2/whatsapp-manager/subscriptions/"${CHANNEL_MANAGER_WHATSAPP_NOTIFICATION_WEBHOOK_ID}" \
-u "${VONAGE_API_KEY}:${VONAGE_API_SECRET}"Run your code
Save this file to your machine and run it:
bash delete-notification-webhook.sh
Try it out
When you run the code you will no longer be subscribed to updates for changes to your WhatsApp business account.