How to Get Standard Number Insights Within an ASP.NET App

Published May 24, 2018 by Rabeb Othmani

This is the third article in a step-by-step series on how to use Nexmo’s Number Insight API within an ASP.NET web application.

In the first article, we walked through everything we need to know about Number Insight API, setting up the ASP.NET application and getting ready to explore how to get insights about a phone number.

Then we learnt how to use Number Insight Basic API in the second article in this series : How to Get Basic Number Insights Within an ASP.NET App.

In this article, we will explore Number Insight Standard API.

Number Insight Standard API is a synchronous, easy-to-use RESTful web service. For any phone number you can:

  • Retrieve the international and local format.
  • Know the country where the number is registered.
  • Line type detection (mobile/landline/virtual number/premium/toll-free).
  • Detect mobile country code (MCC) and mobile network code (MNC).
  • Detect if number is ported.
  • Identify caller name (USA only).
  • Check if phone number is reachable.

Hands on code

In order to get standard insights for a phone number, we will create a view where we can put a number. By clicking on the ‘Submit’ button, we are going to fetch standard insights then publish them on a results view.

Let’s start by creating the method that would allow the navigation to the standard insights view in NumberInsightController.cs

We will now add the view Standard.cshtml under the NumberInsight views folder.

Next, we are going to request standard insights from the API.

StandardResults() and StandardResults.cshtml will allow us to view the results.

Now, let’s run the app and try to get standard Number Insight.
You can use one of the Nexmo numbers provided for testing.



Recap

In this article, we learnt how to use Nexmo’s Number Insight Standard API to retrieve the international and national formats of a phone number, the country where the number is registered and information about its portability and reachability. Then we showed this information on a view within an ASP.NET application.
If you’d like to learn how to get Advanced Number Insights, then tune in to the next article in this series.

Nexmo Number Insight getting started guide for ASP.NET

Leave a Reply

Your email address will not be published.