I have a twilio account for sending SMS. However, i need guidance on how to see a list of my account phone numbers by calling its API. I have tried to navigate through the different menus in API but i dont see any option to get list of my account phone numbers. Thank you in advance for your guidance.
Best How To :
Twilio developer evangelist here.
If you want to list the phone numbers you have in your Twilio account through the API you need the Incoming Phone Numbers list resource.
You can access this easily with the Twilio rubygem like so:
@client = Twilio::REST::Client.new YOUR_ACCOUNT_SID, YOUR_AUTH_TOKEN
numbers = @client.account.incoming_phone_numbers.list
numbers.each do |number|
# do something with the number