user2203676
user2203676

Reputation:

What are valid country codes while searching for Available Numbers in Twilio

Hi I am trying to fetch the available countries in Twilio. For example for US I use below API: Local.reader("US").setVoiceEnabled(true).setSmsEnabled(true). For United Kingdom, I use Local.reader("GB").setVoiceEnabled(true).setSmsEnabled(true). How can I get the list of valid country codes. I am unable to find it in Twilio API docs. Many Thanks shekup

Upvotes: 0

Views: 232

Answers (1)

Alex Baban
Alex Baban

Reputation: 11692

I believe it follows the ISO country code.
You can find more at https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2

Twilio's API is open source, if you're interested you can read the code on GitHub.

For example in this page https://github.com/twilio/twilio-php/blob/master/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/NationalList.php you can see the comment:

* @param string $countryCode The ISO Country code to lookup phone numbers for.

Upvotes: 1

Related Questions