List available phone number machine to machine

GET /2010-04-01/Accounts/{AccountSid}/AvailablePhoneNumbers/{CountryCode}/MachineToMachine.json

Available machine-to-machine phone numbers

Path parameters

  • AccountSid string Required

    The SID of the Account requesting the AvailablePhoneNumber resources.

  • CountryCode string(iso-country-code) Required

    The ISO-3166-1 country code of the country from which to read phone numbers.

Query parameters

  • AreaCode integer

    The area code of the phone numbers to read. Applies to only phone numbers in the US and Canada.

  • Contains string

    The pattern on which to match phone numbers. Valid characters are *, 0-9, a-z, and A-Z. The * character matches any single digit. For examples, see Example 2 and Example 3. If specified, this value must have at least two characters.

  • SmsEnabled boolean

    Whether the phone numbers can receive text messages. Can be: true or false.

  • MmsEnabled boolean

    Whether the phone numbers can receive MMS messages. Can be: true or false.

  • Whether the phone numbers can receive calls. Can be: true or false.

  • Whether to exclude phone numbers that require an Address. Can be: true or false and the default is false.

  • Whether to exclude phone numbers that require a local Address. Can be: true or false and the default is false.

  • Whether to exclude phone numbers that require a foreign Address. Can be: true or false and the default is false.

  • Beta boolean

    Whether to read phone numbers that are new to the Twilio platform. Can be: true or false and the default is true.

  • NearNumber string(phone-number)

    Given a phone number, find a geographically close number within distance miles. Distance defaults to 25 miles. Applies to only phone numbers in the US and Canada.

  • Given a latitude/longitude pair lat,long find geographically close numbers within distance miles. Applies to only phone numbers in the US and Canada.

  • Distance integer

    The search radius, in miles, for a near_ query. Can be up to 500 and the default is 25. Applies to only phone numbers in the US and Canada.

  • Limit results to a particular postal code. Given a phone number, search within the same postal code as that number. Applies to only phone numbers in the US and Canada.

  • InRegion string

    Limit results to a particular region, state, or province. Given a phone number, search within the same region as that number. Applies to only phone numbers in the US and Canada.

  • Limit results to a specific rate center, or given a phone number search within the same rate center as that number. Requires in_lata to be set as well. Applies to only phone numbers in the US and Canada.

  • InLata string

    Limit results to a specific local access and transport area (LATA). Given a phone number, search within the same LATA as that number. Applies to only phone numbers in the US and Canada.

  • Limit results to a particular locality or city. Given a phone number, search within the same Locality as that number.

  • FaxEnabled boolean

    Whether the phone numbers can receive faxes. Can be: true or false.

  • PageSize integer

    How many resources to return in each list page. The default is 50, and the maximum is 1000.

    Minimum value is 1, maximum value is 1000.

Responses

  • 200

    OK

    Hide response attributes Show response attributes object
GET /2010-04-01/Accounts/{AccountSid}/AvailablePhoneNumbers/{CountryCode}/MachineToMachine.json
curl \
 -X GET https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/AvailablePhoneNumbers/{CountryCode}/MachineToMachine.json \
 --user "username:password"
Response examples (200)
{
  "available_phone_numbers": [
    {
      "address_requirements": "string",
      "beta": true,
      "capabilities": {
        "fax": true,
        "mms": true,
        "sms": true,
        "voice": true
      },
      "friendly_name": "string",
      "iso_country": "string",
      "lata": "string",
      "latitude": "string",
      "locality": "string",
      "longitude": "string",
      "phone_number": "string",
      "postal_code": "string",
      "rate_center": "string",
      "region": "string"
    }
  ],
  "end": 42,
  "first_page_uri": "https://example.com",
  "next_page_uri": "https://example.com",
  "page": 42,
  "page_size": 42,
  "previous_page_uri": "https://example.com",
  "start": 42,
  "uri": "https://example.com"
}