Initializes a new instance of the PhoneNumberAdministrationClient class using a connection string.
Connection string to connect to an Azure Communication Service resource. (eg: endpoint=https://contoso.eastus.communications.azure.net/;accesskey=secret)
Optional
options: PhoneNumbersClientOptionsOptional. Options to configure the HTTP pipeline.
Initializes a new instance of the PhoneNumberAdministrationClient class using an Azure KeyCredential.
The endpoint of the service (eg: https://contoso.eastus.communications.azure.net)
An object that is used to authenticate requests to the service. Use the Azure KeyCredential or @azure/identity
to create a credential.
Optional
options: PhoneNumbersClientOptionsOptional. Options to configure the HTTP pipeline.
Initializes a new instance of the PhoneNumberAdministrationClient class using a TokenCredential.
The endpoint of the service (ex: https://contoso.eastus.communications.azure.net).
TokenCredential that is used to authenticate requests to the service.
Optional
options: PhoneNumbersClientOptionsOptional. Options to configure the HTTP pipeline.
Starts the purchase of the phone number(s) in the search associated with a given id.
This function returns a Long Running Operation poller that allows you to wait indefinitely until the operation is complete.
Example usage:
const client = new PhoneNumbersClient(CONNECTION_STRING);
const purchasePoller = await client.beginPurchasePhoneNumbers(SEARCH_ID);
// Serializing the poller
const serialized = purchasePoller.toString();
// Waiting until it's done
const results = await purchasePoller.pollUntilDone();
console.log(results);
The id of the search to purchase. Returned from beginSearchAvailablePhoneNumbers
Additional request options.
Starts the release of a purchased phone number.
This function returns a Long Running Operation poller that allows you to wait indefinitely until the operation is complete.
Example usage:
const client = new PhoneNumbersClient(CONNECTION_STRING);
const releasePoller = await client.beginReleasePhoneNumber("+14125550100");
// Serializing the poller
const serialized = releasePoller.toString();
// Waiting until it's done
const results = await releasePoller.pollUntilDone();
console.log(results);
The E.164 formatted phone number being released. The leading plus can be either + or encoded as %2B.
Additional request options.
Starts a search for phone numbers given some constraints such as name or area code. The phone numbers that are found are reserved until you cancel, purchase or the reservation expires.
This function returns a Long Running Operation poller that allows you to wait indefinitely until the operation is complete.
Example usage:
const client = new PhoneNumberAdministrationClient(CONNECTION_STRING);
const searchPoller = await client.beginSearchAvailablePhoneNumbers(SEARCH_REQUEST);
// Serializing the poller
const serialized = searchPoller.toString();
// Waiting until it's done
const results = await searchPoller.pollUntilDone();
console.log(results);
Request properties to constraint the search scope.
Additional request options.
Starts the update of a purchased phone number's capabilities.
This function returns a Long Running Operation poller that allows you to wait indefinitely until the operation is complete.
Example usage:
const client = new PhoneNumbersClient(CONNECTION_STRING);
const updatePoller = await client.beginUpdatePhoneNumberCapabilities("+14125550100", UPDATE_REQUEST);
// Serializing the poller
const serialized = updatePoller.toString();
// Waiting until it's done
const results = await updatePoller.pollUntilDone();
console.log(results);
The E.164 formatted phone number being updated. The leading plus can be either + or encoded as %2B.
The updated properties which will be applied to the phone number.
Additional request options.
Gets the details of a purchased phone number. Includes phone number, cost, country code, etc.
The E.164 formatted phone number being fetched. The leading plus can be either + or encoded as %2B.
Additional request options.
Iterates the available countries.
Example usage:
let client = new PhoneNumbersClient(credentials);
for await (const country of client.listAvailableCountries()) {
console.log("country: ", country.localizedName);
}
List all available countries.
The optional parameters.
Iterates the available Geographic area codes.
Example usage:
let client = new PhoneNumbersClient(credentials);
for await (const areaCodeItem of client.listGeographicAreaCodes()) {
console.log("area code: ", areaCodeItem.areaCode);
}
List all available Geographic area codes.
The ISO 3166-2 country code.
The optional parameters.
Iterates the available localities.
Example usage:
let client = new PhoneNumbersClient(credentials);
for await (const locality of client.listAvailableLocalities()) {
console.log("locality: ", locality.localizedName);
}
List all available localities.
The ISO 3166-2 country code.
The optional parameters.
Iterates the available offerings.
Example usage:
let client = new PhoneNumbersClient(credentials);
for await (const offering of client.listAvailableOfferings()) {
console.log("phone number type: ", offering.phoneNumberType);
console.log("cost: ", offering.cost.amount);
}
List all available offerings.
The ISO 3166-2 country code.
The optional parameters.
Iterates the available Toll-Free area codes.
Example usage:
let client = new PhoneNumbersClient(credentials);
for await (const areaCodeItem of client.listTollFreeAreaCodes()) {
console.log("area code: ", areaCodeItem.areaCode);
}
List all available Toll-Free area codes.
The ISO 3166-2 country code.
The optional parameters.
Iterates the purchased phone numbers.
Example usage:
let client = new PhoneNumbersClient(credentials);
for await (const purchased of client.listPhoneNumbers()) {
console.log("phone number: ", purchased.phoneNumber);
}
List all purchased phone numbers.
The optional parameters.
Generated using TypeDoc
Client class for interacting with Azure Communication Services Phone Number Administration.