Phone Numbers - List Area Codes
Gets the list of available area codes.
GET {endpoint}/availablePhoneNumbers/countries/{countryCode}/areaCodes?phoneNumberType={phoneNumberType}&api-version=2025-02-11
GET {endpoint}/availablePhoneNumbers/countries/{countryCode}/areaCodes?phoneNumberType={phoneNumberType}&skip={skip}&maxPageSize={maxPageSize}&assignmentType={assignmentType}&locality={locality}&administrativeDivision={administrativeDivision}&api-version=2025-02-11
URI Parameters
Name | In | Required | Type | Description |
---|---|---|---|---|
country
|
path | True |
string |
The ISO 3166-2 country code, e.g. US. |
endpoint
|
path | True |
string (url) |
The communication resource, for example https://resourcename.communication.azure.com |
api-version
|
query | True |
string |
Version of API to invoke |
phone
|
query | True |
Filter by numberType, e.g. Geographic, TollFree. |
|
administrative
|
query |
string |
The name of the state or province in which to search for the area code. |
|
assignment
|
query |
Filter by assignmentType, e.g. Person, Application. |
||
locality
|
query |
string |
The name of locality or town in which to search for the area code. This is required if the number type is Geographic. |
|
max
|
query |
integer (int32) |
An optional parameter for how many entries to return, for pagination purposes. The default value is 100. |
|
skip
|
query |
integer (int32) |
An optional parameter for how many entries to skip, for pagination purposes. The default value is 0. |
Request Header
Name | Required | Type | Description |
---|---|---|---|
accept-language |
string |
The locale to display in the localized fields in the response. e.g. 'en-US' |
Responses
Name | Type | Description |
---|---|---|
200 OK |
Success |
|
Other Status Codes |
Failure |
Examples
Get Area Codes Search Result
Sample request
GET https://resourcename.communication.azure.com//availablePhoneNumbers/countries/CA/areaCodes?phoneNumberType=geographic&locality=Vancouver&administrativeDivision=BC&api-version=2025-02-11
Sample response
{
"areaCodes": [
{
"areaCode": "236"
},
{
"areaCode": "604"
}
]
}
Definitions
Name | Description |
---|---|
Communication |
The Communication Services error. |
Communication |
The Communication Services error. |
Phone |
Represents an Area Code. |
Phone |
The list of available area codes. |
Phone |
Represents the assignment type of the offering. |
Phone |
Represents the number type of the offering. |
CommunicationError
The Communication Services error.
Name | Type | Description |
---|---|---|
code |
string |
The error code. |
details |
Further details about specific errors that led to this error. |
|
innererror |
The inner error if any. |
|
message |
string |
The error message. |
target |
string |
The error target. |
CommunicationErrorResponse
The Communication Services error.
Name | Type | Description |
---|---|---|
error |
The Communication Services error. |
PhoneNumberAreaCode
Represents an Area Code.
Name | Type | Description |
---|---|---|
areaCode |
string |
An area code. |
PhoneNumberAreaCodes
The list of available area codes.
Name | Type | Description |
---|---|---|
areaCodes |
Represents a list of available toll-free area codes. |
|
nextLink |
string |
Represents the URL link to the next page. |
PhoneNumberAssignmentType
Represents the assignment type of the offering.
Value | Description |
---|---|
person | |
application |
PhoneNumberType
Represents the number type of the offering.
Value | Description |
---|---|
geographic | |
tollFree |