Sha256: 731c89f420f6094647aebc438d5c9a222a02746ea3a72d124480dc3de4fff086

Contents?: true

Size: 842 Bytes

Versions: 1

Compression:

Stored size: 842 Bytes

Contents

module Twilio
  # This sub-resource represents only Toll Free phone numbers, or in other words, not local numbers. 
  # Also allows you to request a new toll free phone number be added to your account. 
  # Example:
  #   Twilio.connect('my_twilio_sid', 'my_auth_token')
  #   Twilio::TollFreePhoneNumber.list
  class TollFreePhoneNumber < TwilioObject
    def create(url, area_code = nil, method = 'POST', friendly_name = nil)
      Twilio.post("/IncomingPhoneNumbers/TollFree", :body => {
        :VoiceUrl => url, 
        :AreaCode => area_code, 
        :VoiceMethod => method,
        :FriendlyName => friendly_name 
      })
    end
    
    def list
      Twilio.get("/IncomingPhoneNumbers/TollFree")
    end
    
    def delete(phone_number_sid)
      Twilio.delete("/IncomingPhoneNumbers/#{phone_number_sid}")
    end
    
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
twilio-2.9.0 lib/twilio/toll_free_phone_number.rb