Skip to content

Instantly share code, notes, and snippets.

@hunnycode
Last active December 25, 2015 11:49
Show Gist options
  • Save hunnycode/6972427 to your computer and use it in GitHub Desktop.
Save hunnycode/6972427 to your computer and use it in GitHub Desktop.
# Get twilio-ruby from twilio.com/docs/ruby/install
require 'rubygems' # This line not needed for ruby > 1.8
require 'twilio-ruby'
# Get your Account Sid and Auth Token from twilio.com/user/account
account_sid = 'your account sid'
auth_token = 'your auth token'
@client = Twilio::REST::Client.new account_sid, auth_token
# Loop over numbers and print out a property for each one
@client.account.incoming_phone_numbers.list.each do |number|
puts number.sid
puts number.phone_number
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment