Class: Twilio::TollFreePhoneNumber

Inherits:
TwilioObject show all
Defined in:
lib/twilio/toll_free_phone_number.rb

Overview

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

Instance Attribute Summary

Attributes inherited from TwilioObject

#connection

Instance Method Summary collapse

Methods inherited from TwilioObject

#initialize, method_missing

Constructor Details

This class inherits a constructor from Twilio::TwilioObject

Instance Method Details

#create(url, area_code = nil, method = 'POST', friendly_name = nil) ⇒ Object



8
9
10
11
12
13
14
15
# File 'lib/twilio/toll_free_phone_number.rb', line 8

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

#delete(phone_number_sid) ⇒ Object



21
22
23
# File 'lib/twilio/toll_free_phone_number.rb', line 21

def delete(phone_number_sid)
  Twilio.delete("/IncomingPhoneNumbers/#{phone_number_sid}")
end

#listObject



17
18
19
# File 'lib/twilio/toll_free_phone_number.rb', line 17

def list
  Twilio.get("/IncomingPhoneNumbers/TollFree")
end