Created
February 21, 2018 19:42
-
-
Save mplacona/72ae29c4dd54c024b4e50e70532a4a28 to your computer and use it in GitHub Desktop.
Twilio Voice & SMS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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