Release Notes: Week of 02/04/2013

Here is an update on what we recently deployed in the new IDE, including HTTPS support for agents, in case you haven’t noticed the changes.

  • HTTPS support for agents. We will post an example later this week.
  • Editor panes can be popped out with the arrow icon in the upper right corner in each pane
  • “Run” now saves a version (which you can see in the upper right corner e.g., “build 21”)
  • There should no longer be glitches with log scrolling

The documents will be updated shortly to reflect these updates. We are continuing to add features and fix bugs so please continue to provide your feedback and let us know when something may not be working.

Here’s an example of a function that will send a SMS message using Twilio. (Note all of the unique info e.g., phone numbers, account ID are fictitious). For more info on Twilio, reference http://www.twilio.com/docs/api/rest/sending-sms.

function sendTwilio(message){
local response =
http.post(“https://api.twilio.com/2010-04-01/Accounts/ACeb4f0eca47450d4d0336a14b7c6efbb9/SMS/Messages.json”,
{“Authorization”:“Basic
QUNlYjRmMGVj12345667790YzZlZmJiOToyYjZmYzM0Y2MzYmMyMzllODA4MjUzYjQ4MGY2N2Q4Ng==”},
“From=14085551212&To=3105551212&Body=”+message).sendsync();
server.log(response.statuscode);
server.log(response.body);
}

FYI, for the Authorization header, the term that follows Basic is a base64 encoded username and password. In Twillio’s case it should be “AccountSID:AuthToken”. You can use something like http://www.base64encode.org/ to generate the correct value. I assume Base64 Encode/Decode is something that is coming along with JSON support and URL Encode/Decode?

It is coming (very soon), yes.

Have Agents sending push notifications using Pushover.net

function sendPushOver(){ local response = http.post("https://api.pushover.net/1/messages.json"",{},"token=[app token]&user=[user id]n&title=imp+msg&message=up+at+2010.14RH:60%25").sendasync(function(response) { server.log(response.statuscode); server.log(response.body); }); } sendPushOver();

How do I use http://www.base64encode.org/ to encode the
Authorization Header? (the line after Basic)

Can I use http.base64encode()? Please give me an example?

I see the Auth Token is available on the Twilio dashboard.
Is this what I put after Basic?

Possibly - and this is just from reading the thread:

function sendTwilio(message){ local auth = "Basic "+http.base64encode("AccountSID:AuthToken"); local response = http.post("https://api.twilio.com/2010-04-01/Accounts/ACeb4f0eca47450d4d0336a14b7c6efbb9/SMS/Messages.json", {"Authorization":auth }, "From=14085551212&To=3105551212&Body="+message).sendsync(); server.log(response.statuscode); server.log(response.body); }

Got it working if anyone needs help.
Also makes voice phone calls!
Can accept DTMF key presses to Imp.
Can receive SMS as well.