Skip to content

Repository files navigation

Twilio SDK

Built with APIMatic License: MIT

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.


Installation

Add the .NET SDK as a project reference into your solution:

dotnet add reference <path-to-sdk>/TwilioSdk.csproj

Quick Start

Dependency Injection

Register 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
    });

Direct Instantiation

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);

Usage

For code examples and error responses, see API Reference.

Best Practices

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.

License

This SDK is distributed under the MIT License.


Support

Refer to the API reference for detailed information on available operations with code samples.

For further assistance, please contact support at support@twilio.com.


About

csharp SDK for Twilio

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages