English 中文(简体)
How would I send an SMS from a Kynetx app?
原标题:
  • 时间:2010-11-19 21:04:49
  •  标签:
  • twilio
  • krl

How would I send an SMS to a user using a Kynetx App and Twilio?

最佳回答

I had to do this manually using Twilio s API. Here is a rule which sends an SMS:

rule send_sms {
  pre {
    SMS_url = <<https://#{keys:twilio().pick("$.account_sid")}:#{keys:twilio().pick("$.auth_token")}@api.twilio.com/2010-04-01/Accounts/#{keys:twilio().pick("$.account_sid")}/SMS/Messages>>;
  }
   http:post("#{SMS_url}")
     with params = {
       "From":"+18015555555",
       "To":"+18015555555",
       "Body":"Hello World via SMS!"
     };
}
问题回答

Use the twilio:sms() function. It takes one parameter, it s a string containing the text of the sms. Also make sure you have put your twilio keys in the meta block of your application. Something like this will do the trick:

rule send_sms {
    select when pageview ".*"
    {
       twilio:sms("Wow! I m sending a text message") with to = "1234567890"
    }
}




相关问题
Rails 3 XML Builder / Twilio API

This Twilio API Sample code isn t working in Rails 3: #voice_controller.rb def reminder @postto = BASE_URL + /directions respond_to do |format| format.xml { @postto } end ...

Using twimlets in a Twilio Play verb

I thought it I could specify any URL - including the twimlets used in conference calls - in the Play verb of a TwiML file. However, the following does not work... http://twimlets.com/holdmusic?Bucket=...

Twilio - how do they send/receive SMS

I m interested to find out how twilio s SMS sending/receiving feature works, on long codes, or local numbers Outside of the states, mobile originated SMS terminated on a long number is very common, ...

400 bad request from twilio s REST API using twilio-ruby

I m trying to get started with Twilio s REST API using the rubygem twilio-ruby, and I ve hit a snag. Here s my code: h = {:From => "123-123-1234", :To => "123-123-1234", :Body => "hey"} ...

How does the Twilio website work?

There is a good pitch from Twilio here. I just don t get how they can do that with a website. How can you control a land line with a web browser?

Django | twilio to send SMS

I m using twilio as for a mobile verification mechanism, I have no prior experience in using twilio but looking at the sample PHP code I used this one in my code but apparently it s giving me an 400 ...

IVR vs Asp.net MVC: How can I stop reinventing the browser?

I m making an IVR system for a project, and have decided on Twilio to handle the phone portion (making and receiving calls, sending and receiving SMS messages). This will surface a website with an IVR ...

热门标签