Phone Numbers - List Phone Numbers

Gets the list of all purchased phone numbers.

GET {endpoint}/phoneNumbers?api-version=2021-03-07
GET {endpoint}/phoneNumbers?skip={skip}&top={top}&api-version=2021-03-07

URI Parameters

Name In Required Type Description
endpoint
path True

string

The communication resource, for example https://resourcename.communication.azure.com.

api-version
query True

string

Version of API to invoke.

skip
query

integer

int32

An optional parameter for how many entries to skip, for pagination purposes. The default value is 0.

top
query

integer

int32

An optional parameter for how many entries to return, for pagination purposes. The default value is 100.

Responses

Name Type Description
200 OK

PurchasedPhoneNumbers

Success

Other Status Codes

CommunicationErrorResponse

Failure

Examples

List purchased phone numbers

Sample Request

GET https://resourcename.communication.azure.com//phoneNumbers?api-version=2021-03-07

Sample Response

{
  "phoneNumbers": [
    {
      "id": "11234567890",
      "phoneNumber": "+11234567890",
      "countryCode": "US",
      "assignmentType": "user",
      "phoneNumberType": "geographic",
      "capabilities": {
        "calling": "inbound+outbound",
        "sms": "inbound"
      },
      "purchaseDate": "2020-11-19T16:31:49.048Z",
      "cost": {
        "amount": 0.8,
        "currencyCode": "USD",
        "billingFrequency": "monthly"
      }
    }
  ]
}

Definitions

Name Description
BillingFrequency

The frequency with which the cost gets billed.

CommunicationError

The Communication Services error.

CommunicationErrorResponse

The Communication Services error.

PhoneNumberAssignmentType

The assignment type of the phone numbers to search for. A phone number can be assigned to a person, or to an application.

PhoneNumberCapabilities

Capabilities of a phone number.

PhoneNumberCapabilityType

Capability value for calling.

PhoneNumberCost

The incurred cost for a single phone number.

PhoneNumberType

The type of phone numbers to search for, e.g. geographic, or tollFree.

PurchasedPhoneNumber

Represents a purchased phone number.

PurchasedPhoneNumbers

The list of purchased phone numbers.

BillingFrequency

The frequency with which the cost gets billed.

Name Type Description
monthly

string

CommunicationError

The Communication Services error.

Name Type Description
code

string

The error code.

details

CommunicationError[]

Further details about specific errors that led to this error.

innererror

CommunicationError

The inner error if any.

message

string

The error message.

target

string

The error target.

CommunicationErrorResponse

The Communication Services error.

Name Type Description
error

CommunicationError

The Communication Services error.

PhoneNumberAssignmentType

The assignment type of the phone numbers to search for. A phone number can be assigned to a person, or to an application.

Name Type Description
application

string

person

string

PhoneNumberCapabilities

Capabilities of a phone number.

Name Type Description
calling

PhoneNumberCapabilityType

Capability value for calling.

sms

PhoneNumberCapabilityType

Capability value for SMS.

PhoneNumberCapabilityType

Capability value for calling.

Name Type Description
inbound

string

inbound+outbound

string

none

string

outbound

string

PhoneNumberCost

The incurred cost for a single phone number.

Name Type Description
amount

number

The cost amount.

billingFrequency

BillingFrequency

The frequency with which the cost gets billed.

currencyCode

string

The ISO 4217 currency code for the cost amount, e.g. USD.

PhoneNumberType

The type of phone numbers to search for, e.g. geographic, or tollFree.

Name Type Description
geographic

string

tollFree

string

PurchasedPhoneNumber

Represents a purchased phone number.

Name Type Description
assignmentType

PhoneNumberAssignmentType

The assignment type of the phone number. A phone number can be assigned to a person, or to an application.

capabilities

PhoneNumberCapabilities

Capabilities of a phone number.

cost

PhoneNumberCost

The incurred cost for a single phone number.

countryCode

string

The ISO 3166-2 code of the phone number's country, e.g. US.

id

string

The id of the phone number, e.g. 11234567890.

phoneNumber

string

String of the E.164 format of the phone number, e.g. +11234567890.

phoneNumberType

PhoneNumberType

The phone number's type, e.g. Geographic, TollFree.

purchaseDate

string

The date and time that the phone number was purchased.

PurchasedPhoneNumbers

The list of purchased phone numbers.

Name Type Description
nextLink

string

Represents the URL link to the next page of phone number results.

phoneNumbers

PurchasedPhoneNumber[]

Represents a list of phone numbers.