Package com.vonage.client.insight
Class InsightClient
java.lang.Object
com.vonage.client.AbstractClient
com.vonage.client.insight.InsightClient
public class InsightClient extends AbstractClient
A client for talking to the Vonage Number Insight API. The standard way to obtain an instance of this class is to use
VonageClient.getInsightClient().-
Field Summary
-
Constructor Summary
Constructors Constructor Description InsightClient(HttpWrapper httpWrapper)Constructor. -
Method Summary
Modifier and Type Method Description AdvancedInsightResponsegetAdvancedNumberInsight(AdvancedInsightRequest advancedInsightRequest)Perform an Advanced Insight Request with aAdvancedInsightRequest.AdvancedInsightResponsegetAdvancedNumberInsight(java.lang.String number)Perform an Advanced Insight Request with a number.AdvancedInsightResponsegetAdvancedNumberInsight(java.lang.String number, java.lang.String country)Perform an Advanced Insight Request with a number and country.AdvancedInsightResponsegetAdvancedNumberInsight(java.lang.String number, java.lang.String country, java.lang.String ipAddress)Deprecated.Create aAdvancedInsightRequestand usegetAdvancedNumberInsight(AdvancedInsightRequest)AdvancedInsightResponsegetAdvancedNumberInsight(java.lang.String number, java.lang.String country, java.lang.String ipAddress, boolean cnam)Deprecated.Create aAdvancedInsightRequestand usegetAdvancedNumberInsight(AdvancedInsightRequest)BasicInsightResponsegetBasicNumberInsight(BasicInsightRequest basicInsightRequest)Perform a Basic Insight Request with aBasicInsightRequest.BasicInsightResponsegetBasicNumberInsight(java.lang.String number)Perform a Basic Insight Request with a number.BasicInsightResponsegetBasicNumberInsight(java.lang.String number, java.lang.String country)Perform a Basic Insight Request with a number and country.StandardInsightResponsegetStandardNumberInsight(StandardInsightRequest standardInsightRequest)Perform a Standard Insight Request with aStandardInsightRequest.StandardInsightResponsegetStandardNumberInsight(java.lang.String number)Perform a Standard Insight Request with a number.StandardInsightResponsegetStandardNumberInsight(java.lang.String number, java.lang.String country)Perform a Standard Insight Request with a number and country.StandardInsightResponsegetStandardNumberInsight(java.lang.String number, java.lang.String country, boolean cnam)Deprecated.Create aStandardInsightRequestand usegetStandardNumberInsight(StandardInsightRequest)
-
Field Details
-
Constructor Details
-
InsightClient
Constructor.- Parameters:
httpWrapper- (required) shared HTTP wrapper object used for making REST calls.
-
-
Method Details
-
getBasicNumberInsight
public BasicInsightResponse getBasicNumberInsight(java.lang.String number) throws VonageResponseParseException, VonageClientExceptionPerform a Basic Insight Request with a number.- Parameters:
number- A single phone number that you need insight about in national or international format.- Returns:
- A
BasicInsightResponserepresenting the response from the Vonage Number Insight API. - Throws:
VonageResponseParseException- if the response from the API could not be parsed.VonageClientException- if there was a problem with the Vonage request or response objects.
-
getBasicNumberInsight
public BasicInsightResponse getBasicNumberInsight(java.lang.String number, java.lang.String country) throws VonageResponseParseException, VonageClientExceptionPerform a Basic Insight Request with a number and country.- Parameters:
number- A single phone number that you need insight about in national or international formatcountry- If a number does not have a country code or it is uncertain, set the two-character country code.- Returns:
- A
BasicInsightResponserepresenting the response from the Vonage Number Insight API. - Throws:
VonageResponseParseException- if the response from the API could not be parsed.VonageClientException- if there was a problem with the Vonage request or response objects.
-
getBasicNumberInsight
public BasicInsightResponse getBasicNumberInsight(BasicInsightRequest basicInsightRequest) throws VonageResponseParseException, VonageClientExceptionPerform a Basic Insight Request with aBasicInsightRequest.- Parameters:
basicInsightRequest- A request object containing the details of the request to make.- Returns:
- A
BasicInsightResponserepresenting the response from the Vonage Number Insight API. - Throws:
VonageResponseParseException- if the response from the API could not be parsed.VonageClientException- if there was a problem with the Vonage request or response objects.
-
getStandardNumberInsight
public StandardInsightResponse getStandardNumberInsight(java.lang.String number) throws VonageResponseParseException, VonageClientExceptionPerform a Standard Insight Request with a number.- Parameters:
number- A single phone number that you need insight about in national or international format.- Returns:
- A
StandardInsightResponserepresenting the response from the Vonage Number Insight API. - Throws:
VonageResponseParseException- if the response from the API could not be parsed.VonageClientException- if there was a problem with the Vonage request or response objects.
-
getStandardNumberInsight
public StandardInsightResponse getStandardNumberInsight(java.lang.String number, java.lang.String country) throws VonageResponseParseException, VonageClientExceptionPerform a Standard Insight Request with a number and country.- Parameters:
number- A single phone number that you need insight about in national or international format.country- If a number does not have a country code or it is uncertain, set the two-character country code.- Returns:
- A
StandardInsightResponserepresenting the response from the Vonage Number Insight API. - Throws:
VonageResponseParseException- if the response from the API could not be parsed.VonageClientException- if there was a problem with the Vonage request or response objects.
-
getStandardNumberInsight
@Deprecated public StandardInsightResponse getStandardNumberInsight(java.lang.String number, java.lang.String country, boolean cnam) throws VonageResponseParseException, VonageClientExceptionDeprecated.Create aStandardInsightRequestand usegetStandardNumberInsight(StandardInsightRequest)Perform a Standard Insight Request with a number, country, and cnam.- Parameters:
number- A single phone number that you need insight about in national or international format.country- If a number does not have a country code or it is uncertain, set the two-character country code.cnam- Indicates if the name of the person who owns the phone number should also be looked up and returned. Set to true to receive phone number owner name in the response. This is only available for US numbers and incurs an additional charge.- Returns:
- A
StandardInsightResponserepresenting the response from the Vonage Number Insight API. - Throws:
VonageResponseParseException- if the response from the API could not be parsed.VonageClientException- if there was a problem with the Vonage request or response objects.
-
getStandardNumberInsight
public StandardInsightResponse getStandardNumberInsight(StandardInsightRequest standardInsightRequest) throws VonageResponseParseException, VonageClientExceptionPerform a Standard Insight Request with aStandardInsightRequest.- Parameters:
standardInsightRequest- A request object containing the details of the request to make.- Returns:
- A
StandardInsightResponserepresenting the response from the Vonage Number Insight API. - Throws:
VonageResponseParseException- if the response from the API could not be parsed.VonageClientException- if there was a problem with the Vonage request or response objects.
-
getAdvancedNumberInsight
public AdvancedInsightResponse getAdvancedNumberInsight(java.lang.String number) throws VonageResponseParseException, VonageClientExceptionPerform an Advanced Insight Request with a number.- Parameters:
number- A single phone number that you need insight about in national or international format.- Returns:
- A
AdvancedInsightResponserepresenting the response from the Vonage Number Insight API. - Throws:
VonageResponseParseException- if the response from the API could not be parsed.VonageClientException- if there was a problem with the Vonage request or response objects.
-
getAdvancedNumberInsight
public AdvancedInsightResponse getAdvancedNumberInsight(java.lang.String number, java.lang.String country) throws VonageResponseParseException, VonageClientExceptionPerform an Advanced Insight Request with a number and country.- Parameters:
number- A single phone number that you need insight about in national or international format.country- If a number does not have a country code or it is uncertain, set the two-character country code.- Returns:
- A
AdvancedInsightResponserepresenting the response from the Vonage Number Insight API. - Throws:
VonageResponseParseException- if the response from the API could not be parsed.VonageClientException- if there was a problem with the Vonage request or response objects.
-
getAdvancedNumberInsight
@Deprecated public AdvancedInsightResponse getAdvancedNumberInsight(java.lang.String number, java.lang.String country, java.lang.String ipAddress) throws VonageResponseParseException, VonageClientExceptionDeprecated.Create aAdvancedInsightRequestand usegetAdvancedNumberInsight(AdvancedInsightRequest)Perform an Advanced Insight Request with a number, country, and ipAddress.- Parameters:
number- A single phone number that you need insight about in national or international format.country- If a number does not have a country code or it is uncertain, set the two-character country code.ipAddress- The IP address of the user. If supplied, we will compare this to the country the user's phone is located in and return an error if it does not match.- Returns:
- A
AdvancedInsightResponserepresenting the response from the Vonage Number Insight API. - Throws:
VonageResponseParseException- if the response from the API could not be parsed.VonageClientException- if there was a problem with the Vonage request or response objects.
-
getAdvancedNumberInsight
@Deprecated public AdvancedInsightResponse getAdvancedNumberInsight(java.lang.String number, java.lang.String country, java.lang.String ipAddress, boolean cnam) throws VonageResponseParseException, VonageClientExceptionDeprecated.Create aAdvancedInsightRequestand usegetAdvancedNumberInsight(AdvancedInsightRequest)Perform an Advanced Insight Request with a number, country, ipAddress, and cnam.- Parameters:
number- A single phone number that you need insight about in national or international format.country- If a number does not have a country code or it is uncertain, set the two-character country code.ipAddress- The IP address of the user. If supplied, we will compare this to the country the user's phone is located in and return an error if it does not match.cnam- Indicates if the name of the person who owns the phone number should also be looked up and returned. Set to true to receive phone number owner name in the response. This is only available for US numbers and incurs an additional charge.- Returns:
- A
AdvancedInsightResponserepresenting the response from the Vonage Number Insight API. - Throws:
VonageResponseParseException- if the response from the API could not be parsed.VonageClientException- if there was a problem with the Vonage request or response objects.
-
getAdvancedNumberInsight
public AdvancedInsightResponse getAdvancedNumberInsight(AdvancedInsightRequest advancedInsightRequest) throws VonageResponseParseException, VonageClientExceptionPerform an Advanced Insight Request with aAdvancedInsightRequest.- Parameters:
advancedInsightRequest- A request object containing the details of the request to make.- Returns:
- A
AdvancedInsightResponserepresenting the response from the Vonage Number Insight API. - Throws:
VonageResponseParseException- if the response from the API could not be parsed.VonageClientException- if there was a problem with the Vonage request or response objects.
-