JavaScript
Webhook errors
If the webhooks you created using the vis/v1/self/webhooks/ endpoint cannot be reached or returns a 404 or 500, that webhook is considered inactivate and you will not see any incoming payload to it. You can query the status of all the webhooks by making a GET call to the following endpoint:
https://api.vonage.com/t/vbc.prod/vis/v1/self/webhooks/
This will return a list of all the webhooks that are associated with your application:
In the example above, the lastErrorMessage shows an error when the webhook was called.
To receive events to the same webhook, you will need to make another POST request to create the webhook:
curl --location --request POST 'https://api.vonage.com/t/vbc.prod/vis/v1/self/webhooks/' \ --header 'Authorization: Bearer {ACCESS_TOKEN}' \ --header 'Content-Type: application/json' \ --data-raw '{ "url": "https://{NGROK_URL}/webhook", "events": [ "CALL" ], "signingAlgo": "HMAC_SHA256", "signingKey": "string", "metadataPolicy": "NONE"
You will then see the incoming events after the webhook has been updated.
Receiving call events using webhooks
Create a webhook to receive events from calls
Steps
1
Introduction to this task2
Prerequisites3
Create a webhook4
Create a local server5
Create a webhook6
Cleanup7
What's next?