Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying Twilio Best Practices
  • Table Of Contents Toc
  • Feedback & Rating feedback
Twilio Best Practices

Twilio Best Practices

By : Rogers
4.5 (4)
close
close
Twilio Best Practices

Twilio Best Practices

4.5 (4)
By: Rogers

Overview of this book

If you have experience with at least one programming language and are looking to integrate Twilio into your applications, then this book is for you.
Table of Contents (10 chapters)
close
close
9
Index

C#


The C# Twilio library is available on NuGet (https://www.nuget.org), which is the standard package manager for the Microsoft .NET platform. If you don't have it installed, check out http://docs.nuget.org/docs/start-here/installing-nuget for instructions.

To install the package in Visual Studio from within your project, right-click on References in your project, choose the Manage NuGet Packages option (shown in the following screenshot), and then search for Twilio. Find the Twilio package, and then click on Install.

In your code, you'll just need to import the library and then instantiate a client (client.cs):

using Twilio;
var accountSid = System.Environment.GetEnvironmentVariable("TWILIO_ACCOUNT_SID")
var authToken = System.Environment.GetEnvironmentVariable("TWILIO_AUTH_TOKEN")
var client = new TwilioRestClient(accountSid, authToken);

Once you've set up your client, the syntax for sending a message is comparable to PHP with pre-determined argument lists (send_sms.cs):

var message = client...

Unlock full access

Continue reading for free

A Packt free trial gives you instant online access to our library of over 7000 practical eBooks and videos, constantly updated with the latest in tech

Create a Note

Modal Close icon
You need to login to use this feature.
notes
bookmark search playlist font-size

Change the font size

margin-width

Change margin width

day-mode

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Delete Bookmark

Modal Close icon
Are you sure you want to delete it?
Cancel
Yes, Delete

Delete Note

Modal Close icon
Are you sure you want to delete it?
Cancel
Yes, Delete

Edit Note

Modal Close icon
Write a note (max 255 characters)
Cancel
Update Note

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY