.NET Twilio Server Library by Tony Gravagno
Time to read: 2 minutes
community to benefit from. One such developer is Tony Gravagno, President of Nebula Research and Development. Tony does a lot of work with
.NET and wanted to simplify working with the Twilio APIs. Existing open source options were incomplete so Tony started work
on Twilio Server Library (or TSL.NET for short).
TSL.NET covers both major use cases for working with Twilio: the REST API and TwiML responses. Lets take a look at a couple
examples of how the library works.
REST API
With complete coverage of the Twilio REST API, TSL.NET makes sending a text message as easy as two lines of code:
You can also easily initiate a call:
That’s just the beginning of what the TwilioRestClient supports. You can read more about the other features here.
TwiML
TSL.NET originally started out focusing on TwiML generation inspired the PHP Helper Library. These libraries
are designed to make it easy to dynamically build TwiML from code. Let’s take a look at a simple example.
Let’s say we need some TwiML for a simple voicemail app:
Generating this can be accomplished with the following C#:
If you’re using Webforms, you can return that string using Response.Write from your generic handler or codebehind (just make sure
you set the Response.ContentType = “application/xml”). If you’re using ASP.NET MVC, you can return the XML from a controller action.
Nesting of verbs is also supported. For instance to nest a verb inside a
building your Twilio-based application, or integrating voice and SMS functionality into existing .NET applications. To learn more about the project, visit the project home page on CodePlex, check out the documentation or download the latest version and play with some of the included examples.
Related Posts
Related Resources
Twilio Docs
From APIs to SDKs to sample apps
API reference documentation, SDKs, helper libraries, quickstarts, and tutorials for your language and platform.
Resource Center
The latest ebooks, industry reports, and webinars
Learn from customer engagement experts to improve your own communication.
Ahoy
Twilio's developer community hub
Best practices, code samples, and inspiration to build communications and digital engagement experiences.