sdk/communication/Azure.Communication.ShortCodes/README.md
The phone numbers library provides capabilities for short codes administration.
Install the Azure Communication Server Calling client library for .NET with NuGet:
dotnet add package Azure.Communication.ShortCodes --prerelease
You need an Azure subscription and a Communication Service Resource to use this package.
To create a new Communication Service, you can use the Azure Portal, the Azure PowerShell, or the .NET management client library.
SMS clients can be authenticated using the connection string acquired from an Azure Communication Resource in the Azure Portal.
The short codes package exposes the ShortCodesClient which provides methods to manage short codes.
Short Codes come in two types; shortCode and alphaId. ShortCode = 5 digit number | alphaId = alphanumeric 5 digit combination.
Short codes are a type of number that are available to enterprise customers. They come in the form of a 5 or 6 digit number and can be used to send sms similar to how a toll-free or geographic number is used. In order to acquire a short code it is necessary to submit an application, or program brief.
A program brief tracks the application for a short code and contains all the information necessary to process the application as well as information on the status of the application and any updates that may be needed. It can take 8-12 weeks for a program brief to be approved and a short code to be issued once the program brief is submitted.
// Get a connection string to our Azure Communication resource.
var connectionString = "<connection_string>";
var client = new ShortCodesClient(connectionString);
var pageable = client.GetShortCodesAsync();
await foreach (var shortCode in pageable)
{
Console.WriteLine($"Short Code Number: {shortCode.Number}");
}
A RequestFailedException is thrown as a service response for any unsuccessful requests. The exception contains information about what response code was returned from the service.
Read more about Short Codes in Azure Communication Services.
This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit cla.microsoft.com.
This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.
<!-- LINKS -->