Twilio 短信问题 [英] Twilio sms question

查看:36
本文介绍了Twilio 短信问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

直到现在我一直在使用 Twilio 打电话.现在我希望能够有一个网络监控工具,当一个号码出现问题时,它会发短信.我想这样做,以便当 twilio 收到文本时,它将执行我放入其 URL 的脚本......我真的不知道如何开始使用 sms,与电话相比,它似乎非常困难和复杂电话......非常感谢对短信的任何帮助,让我开始.

Uptill now I have been using Twilio for phone calls. Now I want to be able to have a network monitoring tool that texts when there is a problem to a number. I would like to make it so that when twilio receives the text it will execute the script that I have put into its URL...I really don't know how to get started with sms it seems very hard and complicated as compared to phone calls...Any help on the sms is greatly appreciated to get me started.

推荐答案

如果您已经了解 Twilio 语音通话,那么一旦您了解他们正在做什么,您就会发现 SMS 更容易.本质上是:

If you've already figured Twilio voice calls, you'll find SMS easier once you figure out what they're doing. Which is essentially:

  1. 运营商向 Twilio 发送一条短信,获取您从他们那里租用的号码.
  2. Twilio 向您在其网络管理中设置的 URL 发出 HTTP POST 或 GET(您选择).文本消息的内容将是其中的一个参数.
  3. 您可以使用 POST 或 GET 做任何您想做的事情,如果您使用 POST 或 GET,则返回 TwiML如果没有,想要发送短信回复或什么都不发送.
  1. Carrier delivers an SMS to Twilio for a number you're renting from them.
  2. Twilio makes an HTTP POST or GET (you choose) to the URL you setup in their web admin. The content of the text message will be a parameter in there.
  3. You do whatever you want with the POST or GET, returning a TwiML if you want an SMS reply sent or nothing if not.

请注意,Twilio 无法为您执行脚本,除非它是 TwiML,在这种情况下,您只需返回 TwiML 作为对来自 #3 的 HTTP 调用的响应.因此,如果您想某事以响应 SMS,您需要将其构建到处理您提供给 Twilio 的 URL 的逻辑中.如果你仍然有点迷茫,请告诉我们你是如何尝试这样做的,例如,你有一个 Rails 应用程序、一个 PHP 网站,或者只是一个你想运行的 Bash 脚本,但没有别的……

Note, Twilio can't execute a script for you, unless it's TwiML, in which case you're just returning TwiML as the response to the HTTP call from #3. So if you want to do something in response to an SMS, you'll need build that something into the logic that handles the URL you've given Twilio. If you're still lost a bit, tell us about how you're trying to do this, e.g., you've a Rails app, a PHP website, or just a Bash script you want to run and nothing else yet...

这篇关于Twilio 短信问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆