class Phaxio::Resources::Public::AreaCode

Information about area codes for provisioning numbers.

@see Phaxio::Resources::PhoneNumber.list_available_area_codes

Constants

AVAILABLE_AREA_CODES_PATH

Public Class Methods

list(params = {}) click to toggle source

@macro paging Displays a list of area codes available for purchasing Phaxio numbers. This operation requires no authentication and can be used without passing an API key. @param params [Hash]

A hash of parameters to send to Phaxio.
- *toll_free* [true|false] - If set to *true*, only toll free area codes will be
  returned. If specified and set to *false*, only non-toll free area codes will be
  returned.
- *country_code* [Integer] - An E.164 country code you'd like to filter by.
- *country* [String] - A two character country abbreviation (ISO 3166; e.g. "US" or
  "CA") you'd like to filter by.
- *state* [String] - A two character state or province abbreviation (ISO 3166; e.g.
  "IL" or "YT") you'd like to filter by. When using this parameter, *country_code* or
  *country* must also be provided.

@return [Phaxio::Resource::Collection<Phaxio::Resources::AreaCode>] A collection of

AreaCode objects.

@raise [Phaxio::Error::PhaxioError] @see www.phaxio.com/docs/api/v2/public/list_area_codes

# File lib/phaxio/resources/public/area_code.rb, line 50
def list params = {}
  response = Client.request :get, available_area_codes_endpoint, params
  AreaCode.response_collection response
end

Private Class Methods

available_area_codes_endpoint() click to toggle source
# File lib/phaxio/resources/public/area_code.rb, line 57
def available_area_codes_endpoint
  AVAILABLE_AREA_CODES_PATH
end