Number Insight Advanced (Synchronous)

This code snippet shows you how to use Number Insight Advanced API synchronously.

Note: Vonage does not recommend this approach, because it can result in timeouts. In most cases, you should use an asynchronous call to the Number Insight API.

Before attempting to run the code examples, replace the variable placeholders:

KeyDescription
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.

REAL_TIME_DATA

An optional flag to determine if you want real time data back in the response.

Write the code

Add the following to ni-advanced.sh:

View full source

Run your code

Save this file to your machine and run it:

sh ni-advanced.sh

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