Phone Numbers - Purchase Phone Numbers

Purchases phone numbers.

POST {endpoint}/availablePhoneNumbers/:purchase?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.

Request Body

Name Type Description
searchId

string

The search id.

Responses

Name Type Description
202 Accepted

The service has accepted the request and will start processing later. It will return 'Accepted' immediately and include an 'Operation-Location' and 'Location' headers. Client side should further query the operation status using the URL specified in 'Operation-Location' header. When operation completes successfully query final result using URL specified in 'Location' header.

Headers

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

CommunicationErrorResponse

Failure

Examples

Purchase phone numbers

Sample Request

POST https://resourcename.communication.azure.com//availablePhoneNumbers/:purchase?api-version=2021-03-07

{
  "searchId": "378ddf60-81be-452a-ba4f-613198ea6c28"
}

Sample Response

Operation-Location: /phoneNumbers/operations/purchase_378ddf60-81be-452a-ba4f-613198ea6c28
operation-id: purchase_378ddf60-81be-452a-ba4f-613198ea6c28
purchase-id: 378ddf60-81be-452a-ba4f-613198ea6c28

Definitions

Name Description
CommunicationError

The Communication Services error.

CommunicationErrorResponse

The Communication Services error.

PhoneNumberPurchaseRequest

The phone number search purchase request.

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.

PhoneNumberPurchaseRequest

The phone number search purchase request.

Name Type Description
searchId

string

The search id.