Reputation: 1136
I can send an SMS message to my phone very easily based on the tutorials that Twilio provides, however, I can't seem to find a way to get my program to read the message that I respond with via my cell phone. Is this even possible?
static void Main(string[] args)
{
//Login to the Twilio Account
string AccountSid = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
string AuthToken = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
var Twilio = new TwilioRestClient(AccountSid, AuthToken);
var message = Twilio.SendMessage("+TwilioNumber", "+CellNumber", "Hello World");
var sms = Twilio.GetMessage(message.Sid);
Console.Write(sms.Body);
Console.Read();
}
Upvotes: 1
Views: 647
Reputation: 73027
Twilio developer evangelist here.
You absolutely can receive messages sent to your Twilio number and read the incoming messages. I recommend you take a read through this messaging QuickStart for C#: https://www.twilio.com/docs/quickstart/csharp/sms
You can then follow that up by checking out the API documentation for how Twilio sends the incoming message to you: https://www.twilio.com/docs/api/twiml/sms/twilio_request
Let me know if that helps.
Upvotes: 1