你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

Phone Numbers - List Phone Numbers

获取所有已购买电话号码的列表。

GET {endpoint}/phoneNumbers?api-version=2025-04-01
GET {endpoint}/phoneNumbers?skip={skip}&top={top}&api-version=2025-04-01

URI 参数

名称 必需 类型 说明
endpoint
path True

string (url)

通信资源,例如 https://resourcename.communication.azure.com

api-version
query True

string

要调用的 API 版本

skip
query

integer (int32)

一个可选参数,用于用于分页目的要跳过的条目数。 默认值为 0。

top
query

integer (int32)

用于返回的条目数的可选参数,用于分页目的。 默认值为 100。

响应

名称 类型 说明
200 OK

PurchasedPhoneNumbers

成功

Other Status Codes

CommunicationErrorResponse

失败

示例

List purchased phone numbers

示例请求

GET https://resourcename.communication.azure.com//phoneNumbers?api-version=2025-04-01

示例响应

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

定义

名称 说明
BillingFrequency

费用计费的频率。

CommunicationError

通信服务错误。

CommunicationErrorResponse

通信服务错误。

PhoneNumberAssignmentType

表示产品/服务的分配类型。

PhoneNumberCapabilities

电话号码的功能。

PhoneNumberCapabilityType

调用的功能值。

PhoneNumberCost

单个电话号码产生的成本。

PhoneNumberType

表示产品/服务的数量类型。

PurchasedPhoneNumber

表示购买的电话号码。

PurchasedPhoneNumbers

已购买电话号码的列表。

BillingFrequency

费用计费的频率。

说明
monthly

CommunicationError

通信服务错误。

名称 类型 说明
code

string

错误代码。

details

CommunicationError[]

有关导致此错误的特定错误的更多详细信息。

innererror

CommunicationError

内部错误(如果有)。

message

string

错误消息。

target

string

错误目标。

CommunicationErrorResponse

通信服务错误。

名称 类型 说明
error

CommunicationError

通信服务错误。

PhoneNumberAssignmentType

表示产品/服务的分配类型。

说明
application
person

PhoneNumberCapabilities

电话号码的功能。

名称 类型 说明
calling

PhoneNumberCapabilityType

调用的功能值。

sms

PhoneNumberCapabilityType

SMS 的功能值。

PhoneNumberCapabilityType

调用的功能值。

说明
inbound
inbound+outbound
none
outbound

PhoneNumberCost

单个电话号码产生的成本。

名称 类型 说明
amount

number (double)

成本金额。

billingFrequency

BillingFrequency

费用计费的频率。

currencyCode

string

成本金额的 ISO 4217 货币代码,例如美元。

PhoneNumberType

表示产品/服务的数量类型。

说明
geographic
tollFree

PurchasedPhoneNumber

表示购买的电话号码。

名称 类型 说明
assignmentType

PhoneNumberAssignmentType

电话号码的分配类型。 可将电话号码分配给人员或应用程序。

capabilities

PhoneNumberCapabilities

电话号码的功能。

cost

PhoneNumberCost

单个电话号码产生的成本。

countryCode

string

电话号码国家/地区的 ISO 3166-2 代码,例如美国。

id

string

电话号码的 ID,例如11234567890。

phoneNumber

string

电话号码的 E.164 格式字符串,例如 +11234567890。

phoneNumberType

PhoneNumberType

电话号码的类型,例如地理,tollFree。

purchaseDate

string (date-time)

电话号码的购买日期和时间。

PurchasedPhoneNumbers

已购买电话号码的列表。

名称 类型 说明
nextLink

string

表示指向下一页电话号码结果的 URL 链接。

phoneNumbers

PurchasedPhoneNumber[]

表示电话号码列表。