メニュー

Rate this page:

Thanks for rating this page!

We are always striving to improve our documentation quality, and your feedback is valuable to us. How could this documentation serve you better?

AvailablePhoneNumber resource

The subresources of the AvailablePhoneNumber resource let you search for local, toll-free and mobile phone numbers that are available for you to purchase. You can search for phone numbers that match a pattern, are in a certain country, are in certain area code (NPA) or exchange (NXX) or are in a specific geography.

You cannot make requests directly to AvailablePhoneNumber instance resources. Instead, to find available numbers, make a request to one of the subresources:

サポートされる国とタイプ

You can query the AvailablePhoneNumber resource to get a list of subresources available for your account by ISO Country. For full information about our phone number support, see our Phone Number CSV or the FAQ. Each instance of the resource will have the following properties.

Names in PHP format
countryCode
iso_country_code Not PII

The ISO-3166-1 country code of the country.

country
文字列 Not PII

The name of the country.

uri
url Not PII

The URI of the Country resource, relative to https://api.twilio.com.

beta
boolean Not PII

Whether all phone numbers available in the country are new to the Twilio platform. true if they are and false if all numbers are not in the Twilio Phone Number Beta program.

subresourceUris
uri_map Not PII

A list of related AvailablePhoneNumber resources identified by their URIs relative to https://api.twilio.com.

Fetch a specific country

GET
https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/AvailablePhoneNumbers/{CountryCode}.json
パラメーター
Names in None format
account_sid
必須
GET sid<AC> Not PII

The SID of the Account requesting the available phone number Country resource.

country_code
必須
GET iso_country_code Not PII

The ISO-3166-1 country code of the country to fetch available phone number information about.

例 1
        
        
        
        
        Fetches the subresources available for the US

        Fetch a specific country

        Fetches the subresources available for the US

        Read a list of countries

        GET
        https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/AvailablePhoneNumbers.json
        パラメーター
        Names in None format
        account_sid
        必須
        GET sid<AC> Not PII

        The SID of the Account requesting the available phone number Country resources.

        例 1
              
              
              
              
              Gets the subresources available for all supported countries

              Read a list of countries

              Gets the subresources available for all supported countries
              Rate this page:

              ヘルプが必要ですか?

              We all do sometimes; code is hard. Get help now from our support team, or lean on the wisdom of the crowd browsing the Twilio tag on Stack Overflow.