Method: Vonage::NumberInsight#advanced_async

Defined in:
lib/vonage/number_insight.rb

#advanced_async(params) ⇒ Response

Provides advanced number insight number information asynchronously using the URL specified in the callback parameter.

Examples:

response = client.number_insight.advanced_async(number: '447700900000', callback: webhook_url)

Parameters:

  • params (Hash)

Options Hash (params):

  • :callback (required, String)

    The callback URL.

  • :number (required, String)

    A single phone number that you need insight about in national or international format.

  • :country (String)

    If a number does not have a country code or is uncertain, set the two-character country code. This code must be in ISO 3166-1 alpha-2 format and in upper case. For example, GB or US. If you set country and number is already in E.164 format, country must match the country code in number.

  • :cnam (Boolean)

    Indicates if the name of the person who owns the phone number should be looked up and returned in the response. Set to true to receive phone number owner name in the response. This features is available for US numbers only and incurs an additional charge.

  • :ip (String)

    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:

Raises:

See Also:



132
133
134
135
136
137
138
# File 'lib/vonage/number_insight.rb', line 132

def advanced_async(params)
  response = request('/ni/advanced/async/json', params: params)

  raise ServiceError.new(response: response), response[:status_message] unless response.status.zero?

  response
end