简体   繁体   中英

How to get my Program to read my SMS response using Twilio

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();
    }

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM