Initializes a new instance of the PhoneNumbersClient class.
The communication resource, for example https://resourcename.communication.azure.com.
The parameter options
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)
The parameter options
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.
The parameter options
Initializes a new instance of the PhoneNumberAdministrationClient class using a TokenCredential.
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.
The parameter options
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 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.