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

Phone Numbers - Update Capabilities

更新电话号码的功能。

PATCH {endpoint}/phoneNumbers/{phoneNumber}/capabilities?api-version=2022-12-01

URI 参数

名称 必需 类型 说明
endpoint
path True

string

url

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

phoneNumber
path True

string

E.164 格式的电话号码 ID。 前导加可以是 + 或编码为 %2B,例如 +11234567890。

api-version
query True

string

要调用的 API 版本

请求正文

Media Types: "application/merge-patch+json"

名称 类型 说明
calling

PhoneNumberCapabilityType

调用的功能值。

sms

PhoneNumberCapabilityType

SMS 的功能值。

响应

名称 类型 说明
202 Accepted

PurchasedPhoneNumber

该服务已接受请求,稍后将开始处理。 它将立即返回“Accepted”,并包含“Operation-Location”和“Location”标头。 客户端应使用“Operation-Location”标头中指定的 URL 进一步查询操作状态。 操作使用“位置”标头中指定的 URL 成功完成查询最终结果时。

标头

  • Location: string
  • Operation-Location: string
  • operation-id: string
  • capabilities-id: string
Other Status Codes

CommunicationErrorResponse

失败

示例

Update phoneNumber capabilities

示例请求

PATCH https://resourcename.communication.azure.com//phoneNumbers/+14792000102/capabilities?api-version=2022-12-01

{
  "calling": "inbound+outbound",
  "sms": "none"
}

示例响应

Operation-Location: /phoneNumbers/operations/capabilities_378ddf60-81be-452a-ba4f-613198ea6c28
Location: /phoneNumbers/%2b14792000102
operation-id: capabilities_378ddf60-81be-452a-ba4f-613198ea6c28
capabilities-id: 378ddf60-81be-452a-ba4f-613198ea6c28
{
  "id": "14792000102",
  "phoneNumber": "+14792000102",
  "countryCode": "US",
  "assignmentType": "person",
  "phoneNumberType": "geographic",
  "capabilities": {
    "calling": "inbound+outbound",
    "sms": "none"
  },
  "purchaseDate": "2020-11-19T16:31:49.048Z",
  "cost": {
    "amount": 0.8,
    "currencyCode": "USD",
    "billingFrequency": "monthly"
  }
}

定义

名称 说明
BillingFrequency

费用计费的频率。

CommunicationError

通信服务错误。

CommunicationErrorResponse

通信服务错误。

PhoneNumberAssignmentType

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

PhoneNumberCapabilities

电话号码的功能。

PhoneNumberCapabilitiesRequest

电话号码的功能。

PhoneNumberCapabilityType

调用的功能值。

PhoneNumberCost

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

PhoneNumberType

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

PurchasedPhoneNumber

表示购买的电话号码。

BillingFrequency

费用计费的频率。

名称 类型 说明
monthly

string

CommunicationError

通信服务错误。

名称 类型 说明
code

string

错误代码。

details

CommunicationError[]

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

innererror

CommunicationError

内部错误(如果有)。

message

string

错误消息。

target

string

错误目标。

CommunicationErrorResponse

通信服务错误。

名称 类型 说明
error

CommunicationError

通信服务错误。

PhoneNumberAssignmentType

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

名称 类型 说明
application

string

person

string

PhoneNumberCapabilities

电话号码的功能。

名称 类型 说明
calling

PhoneNumberCapabilityType

调用的功能值。

sms

PhoneNumberCapabilityType

SMS 的功能值。

PhoneNumberCapabilitiesRequest

电话号码的功能。

名称 类型 说明
calling

PhoneNumberCapabilityType

调用的功能值。

sms

PhoneNumberCapabilityType

SMS 的功能值。

PhoneNumberCapabilityType

调用的功能值。

名称 类型 说明
inbound

string

inbound+outbound

string

none

string

outbound

string

PhoneNumberCost

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

名称 类型 说明
amount

number

成本金额。

billingFrequency

BillingFrequency

费用计费的频率。

currencyCode

string

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

PhoneNumberType

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

名称 类型 说明
geographic

string

tollFree

string

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

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