twilio/twilio-csharp — an API project — sits at 714 GitHub stars in the API space. Twilio C#/.NET Helper Library for .NET6+.
Snapshot summary built from the project's own GitHub metadata — there's no written TopGit review yet. The page will update automatically when a full review is published.
WHY NO REVIEW YET
TopGit writes full reviews for the most-starred, most-requested repositories. This page is a snapshot until then — see the READ ME tab for the original README in full.
Twilio provides a HTTP-based API for sending and receiving phone calls and text messages. Learn more on twilio.com.
More documentation for this library can be found here.
Versions
twilio-csharp uses a modified version of Semantic Versioning for all changes. See this document for details.
Migrate from earlier versions
See the migration guide here. Also, if you were using the Twilio.Mvc package, that has been replaced by the Twilio.AspNet.Mvc package which is compatible with this version of the library.
TLS 1.2 Requirements
New accounts and subaccounts are now required to use TLS 1.2 when accessing the REST API. "Upgrade Required" errors indicate that TLS 1.0/1.1 is being used. With .NET, you can enable TLS 1.2 using this setting:
This library supports .NET applications that utilize .NET8+.
Installation
The best and easiest way to add the Twilio libraries to your .NET project is to use the NuGet package manager.
With Visual Studio IDE
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
With .NET Core Command Line Tools
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
Sample usage
The examples below show how to have your application initiate and outbound phone call and send an SMS message using the Twilio .NET helper library:
TwilioClient.Init("ACCOUNT_SID", "AUTH_TOKEN");
var call = CallResource.Create(
new PhoneNumber("+11234567890"),
from: new PhoneNumber("+10987654321"),
url: new Uri("https://my.twiml.here")
);
Console.WriteLine(call.Sid);
var message = MessageResource.Create(
new PhoneNumber("+11234567890"),
from: new PhoneNumber("+10987654321"),
body: "Hello World!"
);
Console.WriteLine(message.Sid);
OAuth Feature for Twilio APIs
We are introducing Client Credentials Flow-based OAuth 2.0 authentication.
API examples here
Organisation API examples here
Specify Region and/or Edge
To take advantage of Twilio's Global Infrastructure, specify the target Region and/or Edge for the client:
This will result in the hostname transforming from api.twilio.com to api.sydney.au1.twilio.com. Use appropriate client depending on the type of authentication used
Enable debug logging
There are two ways to enable debug logging in the default HTTP client. You can create an environment variable called TWILIO_LOG_LEVEL and set it to debug or you can set the LogLevel variable on the client as debug:
TwilioClient.SetLogLevel("debug");
Handle exceptions
For an example on how to handle exceptions in this helper library, please see the Twilio documentation.
Generate TwiML
To control phone calls, your application needs to output TwiML.
// TwiML classes can be created as standalone elements
var gather = new Gather(numDigits: 1, action: new Uri("hello-monkey-handle-key.cshtml"), method: HttpMethod.Post)
.Say("To speak to a real monkey, press 1. Press 2 to record your own monkey howl. Press any other key to start over.");
// Attributes can be set directly on the object
gather.Timeout = 100;
gather.MaxSpeechTime = 200
// Arbitrary attributes can be set by calling set/getOption
var dial = new Dial().SetOption("myAttribute", 200)
.SetOption("newAttribute", false);
// Or can be created and attached to a response directly using helper methods
var response = new VoiceResponse()
.Say("Hello Monkey")
.Play(new Uri("http://demo.twilio.com/hellomonkey/monkey.mp3"))
.Append(gather)
.Append(dial);
// Serialize the TwiML objects to XML string
Console.WriteLine(response);
/*
<?xml version="1.0" encoding="utf-8"?>
<Response>
<Say>Hello Monkey</Say>
<Play>http://demo.twilio.com/hellomonkey/monkey.mp3</Play>
<Gather numDigits="1" action="hello-monkey-handle-key.cshtml" method="POST" timeout="100" maxSpeechTime="200">
<Say>To speak to a real monkey, press 1. Press 2 to record your own monkey howl. Press any other key to start over.</Say>
</Gather>
<Dial myAttribute="200" newAttribute="false"></Dial>
</Response>
*/
Use a custom HTTP Client
To use a custom HTTP client with this helper library, please see the advanced example of how to do so.
Annotations
Beta
Features marked with the [Beta] attribute are in a beta stage and may undergo changes in future releases. Use these features with caution as they may not be stable.
Deprecated
Features marked with the [Deprecated] attribute are deprecated and are not encouraged to use
Preview
Features marked with the [Preview] attribute are in a preview stage and are intended for evaluation purposes. They are subject to change and should not be used in production without thorough testing.
Docker Image
The Dockerfile present in this repository and its respective twilio/twilio-csharp Docker image are used by Twilio for testing purposes.
You could use the docker image for building and running tests:
docker build -t twiliobuild .
Bash:
docker run -it --rm -v $(pwd):/twilio twiliobuild
make test
Powershell:
docker run -it --rm -v ${PWD}:/twilio twiliobuild
make test
Get support
If you need help installing or using the library, please check the Twilio Support Help Center first, and file a support ticket if you don't find an answer to your question.
If you've instead found a bug in the library or would like new features added, go ahead and open issues or pull requests against this repo!
How active is development on twilio/twilio-csharp?
The most recent commit recorded on twilio/twilio-csharp was 11 days ago, based on the GitHub push timestamp. The repository has 318 forks — one of the better signals of community interest.
How many stars does twilio/twilio-csharp have?
twilio/twilio-csharp has 714 GitHub stars — refresh the page for the live number, or check github.com/twilio/twilio-csharp. TopGit mirrors GitHub's count but does not claim minute-by-minute accuracy.
Is twilio/twilio-csharp open source?
Yes — twilio/twilio-csharp ships under the MIT license, which makes its source code freely readable (and, depending on license terms, forkable and reusable). Source: github.com/twilio/twilio-csharp.
What else is in the API space?
twilio/twilio-csharp is tracked by TopGit under the API category, alongside 10 GitHub-tagged topics. Trending and Topics pages list peer repositories of comparable stars and language.
What is twilio/twilio-csharp?
twilio/twilio-csharp (twilio/twilio-csharp) is a C# project on GitHub. From the project's own README: Twilio C#/.NET Helper Library for .NET6+.
What language is twilio/twilio-csharp written in?
twilio/twilio-csharp is written primarily in C#. GitHub's language field is based on the largest share of bytes in the default branch.
What license does twilio/twilio-csharp use?
twilio/twilio-csharp is released under the MIT license. Always verify the LICENSE file directly on GitHub for the authoritative terms — license strings can be edited out of sync with a project's actual stance.
Where do I read more about twilio/twilio-csharp?
This TopGit page is a snapshot — the READ ME tab shows the project's own README content (links stripped, images preserved). The GitHub repository at github.com/twilio/twilio-csharp is the definitive source.
Read full README in the tab above.
Is twilio-csharp worth your time?
ChatGPT, Claude and Perplexity can all read this page. Ask one of them what it makes of twilio-csharp.