Skip to content

Instantly share code, notes, and snippets.

@mplacona
Created February 21, 2018 19:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mplacona/72ae29c4dd54c024b4e50e70532a4a28 to your computer and use it in GitHub Desktop.
Save mplacona/72ae29c4dd54c024b4e50e70532a4a28 to your computer and use it in GitHub Desktop.
Twilio Voice & SMS
using System;
using Twilio;
using Twilio.Rest.Api.V2010.Account;
using Twilio.Types;
namespace Pamphlet
{
internal static class Program
{
private static void Main(string[] args)
{
}
private static void makeCall()
{
// Find your Account Sid and Auth Token at twilio.com/console
TwilioClient.Init("accountSid", "authToken");
CallResource.Create(
to: new PhoneNumber("targetNumber"),
from: new PhoneNumber("twilioNumber"),
url: new Uri("http://demo.twilio.com/docs/voice.xml"));
Console.WriteLine("Call Triggered!");
}
private static void sendText()
{
// Find your Account Sid and Auth Token at twilio.com/console
TwilioClient.Init("accountSid", "authToken");
MessageResource.Create(
to: new PhoneNumber("targetNumber"),
from: new PhoneNumber("twilioNumber"),
body: "Ahoy from C#");
Console.WriteLine("Message sent!");
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment