Enable Template Analytics
In this code snippet you learn how to Enable Template Analytics using the Messages API.
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 |
VONAGE_API_SECRET | Your Vonage API secret (also available on |
CHANNEL_MANAGER_WABA_ID | The |
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 enable-template-analytics.sh:
Copy
curl -X "PATCH" "https://api.nexmo.com/v1/channel-manager/whatsapp/wabas/"${CHANNEL_MANAGER_WABA_ID}"/enable_insights" \
-u "${VONAGE_API_KEY}:${VONAGE_API_SECRET}"Run your code
Save this file to your machine and run it:
bash enable-template-analytics.sh
Try it out
When you run the code a request is made to enable template insights.