Partilhar via


Phone Numbers - Get Search Result

Gets a phone number search result by search id.

GET {endpoint}/availablePhoneNumbers/searchResults/{searchId}?api-version=2025-02-11

URI Parameters

Name In Required Type Description
endpoint
path True

string

url

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

searchId
path True

string

The search Id.

api-version
query True

string

Version of API to invoke

Responses

Name Type Description
200 OK

PhoneNumberSearchResult

Success

Other Status Codes

CommunicationErrorResponse

Failure

Examples

Get PhoneNumber Search Result

Sample request

GET https://resourcename.communication.azure.com//availablePhoneNumbers/searchResults/378ddf60-81be-452a-ba4f-613198ea6c28?api-version=2025-02-11

Sample response

{
  "searchId": "378ddf60-81be-452a-ba4f-613198ea6c28",
  "phoneNumbers": [
    "+18001212121"
  ],
  "phoneNumberType": "tollFree",
  "assignmentType": "application",
  "capabilities": {
    "sms": "inbound+outbound",
    "calling": "none"
  },
  "cost": {
    "amount": 1.2,
    "currencyCode": "USD",
    "billingFrequency": "monthly"
  },
  "searchExpiresBy": "2020-11-19T16:31:49.048Z",
  "errorCode": 1000,
  "error": "OutOfStock"
}

Definitions

Name Description
BillingFrequency

The frequency with which the cost gets billed.

CommunicationError

The Communication Services error.

CommunicationErrorResponse

The Communication Services error.

Error

Mapping Error Messages to Codes

PhoneNumberAssignmentType

Represents the assignment type of the offering.

PhoneNumberCapabilities

Capabilities of a phone number.

PhoneNumberCapabilityType

Capability value for calling.

PhoneNumberCost

The incurred cost for a single phone number.

PhoneNumberSearchResult

The result of a phone number search operation.

PhoneNumberType

Represents the number type of the offering.

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.

Error

Mapping Error Messages to Codes

Name Type Description
AllNumbersNotAcquired

string

AuthorizationDenied

string

BillingUnavailable

string

InvalidAddress

string

InvalidOfferModel

string

MissingAddress

string

NoError

string

NoWallet

string

NotEnoughCredit

string

NotEnoughLicenses

string

NumbersPartiallyAcquired

string

OutOfStock

string

ProvisioningFailed

string

PurchaseFailed

string

ReservationExpired

string

UnknownErrorCode

string

UnknownSearchError

string

PhoneNumberAssignmentType

Represents the assignment type of the offering.

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.

PhoneNumberSearchResult

The result of a phone number search operation.

Name Type Description
assignmentType

PhoneNumberAssignmentType

Phone number's assignment type.

capabilities

PhoneNumberCapabilities

Capabilities of a phone number.

cost

PhoneNumberCost

The incurred cost for a single phone number.

error

Error

Mapping Error Messages to Codes

errorCode

integer

The error code of the search.

phoneNumberType

PhoneNumberType

The phone number's type, e.g. geographic, or tollFree.

phoneNumbers

string[]

The phone numbers that are available. Can be fewer than the desired search quantity.

searchExpiresBy

string

The date that this search result expires and phone numbers are no longer on hold. A search result expires in less than 15min, e.g. 2020-11-19T16:31:49.048Z.

searchId

string

The search id.

PhoneNumberType

Represents the number type of the offering.

Name Type Description
geographic

string

tollFree

string