Number Insight Advanced Webhook
This code snippet shows you how to code the webhook handler that receives the data returned by an asynchronous call to the Number Insight Advanced API. See the Number Insight Advanced code snippet to learn how to code the initial request for the insight data.
Before attempting to run the code examples, replace the variable placeholders:
| 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). |
INSIGHT_NUMBER | The number you want to retrieve insight information for. |
Prerequisites
Create a file named ni-advanced-async.js and add the following code:
Run your code
Save this file to your machine and run it:
Prerequisites
Add the following to build.gradle:
Write the code
Add the following to the main method of the AdvancedInsightWebhook class:
Run your code
We can use the application plugin for Gradle to simplify the running of our application. Update your build.gradle with the following:
Run the following gradle command to execute your application, replacing com.vonage.quickstart.kt.numberinsight with the package containing AdvancedInsightWebhook:
Prerequisites
Add the following to build.gradle:
Write the code
Add the following to the main method of the AsyncInsightTrigger class:
Run your code
We can use the application plugin for Gradle to simplify the running of our application. Update your build.gradle with the following:
Run the following gradle command to execute your application, replacing com.vonage.quickstart.insight with the package containing AsyncInsightTrigger:
Prerequisites
Create a file named NumberInsightsController.cs and add the following code:
Prerequisites
Run your code
Save this file to your machine and run it:
Prerequisites
Run your code
Save this file to your machine and run it:
Prerequisites
Run your code
Save this file to your machine and run it:
The response from the API contains the following data:
For a description of each returned field and to see all possible values, see the Number Insights API documentation