The Twilio SDK SDK for .NET provides access to the Twilio SDK REST APIs from .NET applications.
This is the public Twilio REST API., Manage configurations, conversations, participants, and communications. Create configurations to define capture rules and channel settings, then use conversations to group related communications., This is the public Twilio REST API., This is the public Twilio REST API., This is the public Twilio REST API., This is the public Twilio REST API., This is the public Twilio REST API., This is the public Twilio REST API., This is the public Twilio REST API., This is the public Twilio REST API., This is the public Twilio REST API., This is the reference API for the rest-proxy server., Insights Domain V3 API.
Add the .NET SDK as a project reference into your solution:
dotnet add reference <path-to-sdk>/TwilioSdk.csprojRegister the client with IServiceCollection and resolve it from the container. The HttpClient is managed by IHttpClientFactory. Configure the client's behavior through TwilioSdkClientOptions.
services.AddTwilioSdkClient(options =>
{
options.AccountSidAuthToken =
new BasicAuthCredentials
{
Username = "YOUR_USERNAME",
Password = "YOUR_PASSWORD",
};
options.Environment = ServerEnvironment.Production;
// TODO: configure more client options here
});Create the client by passing an HttpClient you manage yourself. Configure the client's behavior through TwilioSdkClientOptions.
var httpClient = new HttpClient();
// TODO: configure more client options here
var options =
new TwilioSdkClientOptions
{
AccountSidAuthToken = new BasicAuthCredentials
{
Username = "YOUR_USERNAME",
Password = "YOUR_PASSWORD",
},
Environment = ServerEnvironment.Production,
};
var client = new TwilioSdkClient(httpClient, options);For code examples and error responses, see API Reference.
Tip
Use a single TwilioSdkClient instance for the lifetime of your application and
reuse it across all requests. Creating a new instance per request might exhaust the
connection pool.
This SDK is distributed under the MIT License.
Refer to the API reference for detailed information on available operations with code samples.
For further assistance, please contact support at support@twilio.com.