Menu

Rate this page:

Thanks for rating this page!

We are always striving to improve our documentation quality, and your feedback is valuable to us. How could this documentation serve you better?

Twilio SDK for C# and .NET

The Twilio C# / .NET SDK makes it easy to interact with the Twilio API from your .NET application. The most recent version of the library can be found on NuGet. The Twilio C# SDK supports .NET applications written in C#, VB.Net, and F# that utilize the .NET Framework version 3.5 or higher or any .NET runtime supporting .NET Standard v1.4.

Install the Library
When your phone number receives an incoming message or phone call, Twilio will send an HTTP request to your .NET application
1
Twilio servers
Your .NET app tells Twilio how to respond (e.g. with a text message, phone menu, etc.)
2
Your app

// Incoming message from Twilio!
var messagingResponse =
    new MessagingResponse();
messagingResponse.Message("Hello from C#!");
return TwiML(messagingResponse);
View complete examples
Twilio gets the instructions from your .NET app and takes the appropriate action
3
Hello from C#!

Get Started

From within Visual Studio, you can use the NuGet GUI to search for and install the Twilio NuGet package. Or, as a shortcut, simply type the following command into the Package Manager Console:

Install-Package Twilio

If you are building with the .NET Core command line tools, then you can run the following command from within your project directory:

dotnet add package Twilio

Once installed, try one of the code samples to the right or jump into one of the Quickstarts below.

Need to handle Twilio webhooks with ASP.NET MVC or ASP.NET Core? Be sure to also install the corresponding Twilio.AspNet package.

Build your App

You've got an idea in mind. Let's get it to production.

Pick the docs that are right for you. These guides, sample app tutorials, and API reference docs will get you across the deploy line, straight to HTTP 200 OK.

Full .NET SDK Reference

Dig into the Twilio API's and uncover that killer feature you need to make your app awesome.

Common Classes

There are a few common core classes used in the various tutorials and examples. They handle setting up a connection to Twilio, handling errors, and issuing security tokens for client apps.

Common REST API Resource Classes

Each REST API Resource has a corresponding .NET class that you can use to create, fetch, read, update, and delete resources.

Common TwiML Classes

You use TwiML to tell Twilio what to do when you are responding to a Twilio webhook (e.g. a message or a phone call).