Method: Vonage::Numbers#list

Defined in:
lib/vonage/numbers.rb

#list(params = nil) ⇒ ListResponse

Retrieve all the inbound numbers associated with your Vonage account.

Examples:

response = client.numbers.list
response.each do |item|
  puts "#{item.msisdn} #{item.country} #{item.type}"
end

Options Hash (params):

  • :application_id (String)

    The application that you want to return the numbers for.

  • :has_application (Boolean)

    Set this optional field to true to restrict your results to numbers associated with an application (any application). Set to false to find all numbers not associated with any application. Omit the field to avoid filtering on whether or not the number is assigned to an application.

  • :country (String)

    The two character country code to filter on (in ISO 3166-1 alpha-2 format).

  • :pattern (String)

    The number pattern you want to search for. Use in conjunction with :search_pattern.

  • :search_pattern (Integer)

    The strategy you want to use for matching:

    • 0 - Search for numbers that start with :pattern
    • 1 - Search for numbers that contain :pattern
    • 2 - Search for numbers that end with :pattern
  • :size (Integer)

    Page size.

  • :index (Integer)

    Page index.

  • :auto_advance (Boolean)

    Set this to true to auto-advance through all the pages in the record and collect all the data. The default is false.

See Also:



56
57
58
# File 'lib/vonage/numbers.rb', line 56

def list(params = nil)
  request("/account/numbers", params: params, response_class: ListResponse)
end