简体   繁体   English

如何使我的程序使用Twilio阅读我的SMS响应

[英]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. 根据Twilio提供的教程,我可以非常轻松地向手机发送SMS消息,但是,我似乎找不到找到让程序读取通过手机回复的消息的方法。 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. Twilio开发人员布道者在这里。

You absolutely can receive messages sent to your Twilio number and read the incoming messages. 您绝对可以接收发送到您的Twilio号码的消息并阅读传入的消息。 I recommend you take a read through this messaging QuickStart for C#: https://www.twilio.com/docs/quickstart/csharp/sms 我建议您通读此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 然后,您可以通过查看API文档了解Twilio如何将传入消息发送给您,以进行后续操作: https : //www.twilio.com/docs/api/twiml/sms/twilio_request

Let me know if that helps. 让我知道是否有帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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