From fcb70c6b9c5b6f8071ace8abc65cdfd893add712 Mon Sep 17 00:00:00 2001 From: AllAboutEE Date: Mon, 23 Mar 2015 21:37:38 -0500 Subject: [PATCH] Added Twilio Calls API. Added Twilio API page. --- app.yaml | 6 +++++ index.html | 30 +------------------------ twilio.html | 54 +++++++++++++++++++++++++++++++++++++++++++++ twilio/Calls.php | 22 ++++++++++++++++++ twilio/Messages.php | 2 +- 5 files changed, 84 insertions(+), 30 deletions(-) create mode 100644 twilio.html create mode 100644 twilio/Calls.php diff --git a/app.yaml b/app.yaml index b18d499..9776d7e 100644 --- a/app.yaml +++ b/app.yaml @@ -15,6 +15,12 @@ handlers: - url: /twilio/Messages.* script: /twilio/Messages.php +- url: /twilio/Calls.* + script: /twilio/Calls.php + +- url: /twilio.html + script: twilio.html + - url: /bootstrap-3.3.4-dist static_dir: bootstrap-3.3.4-dist diff --git a/index.html b/index.html index bb4cd68..0be301e 100644 --- a/index.html +++ b/index.html @@ -31,40 +31,12 @@

IoT HTTPS Relay

Supported APIs:

Submit API requests as issues with an "enhancement" label to GitHub IoT HTTPS Relay

-

Twilio SMS(Text Messaging)

- -

- To Use the Twilio SMS relay, simply send an HTTP POST request like the following. -
Where the token and sid are provided to you by Twilio. The "From" number must be your Twilio provided number. - The "To" number can be any number, but it can only be your verified number if you are using Twilio's free service. -

-
-            
-POST /twilio/Messages.json HTTP/1.1
-Host: iot-https-relay.appspot.com
-Connection: close
-Content-Type: application/x-www-form-urlencoded
-Content-Length: xxx
-
-token=xxxxxx&From=15558689998&To=19998675584&Body=myURLEncodedMessage&sid=xxxxxx
-
-            
-        
- -

Example Twilio SMS (Text Messaging) With ESP8266 and NodeMcu

- - - - - - - diff --git a/twilio.html b/twilio.html new file mode 100644 index 0000000..a6da9dd --- /dev/null +++ b/twilio.html @@ -0,0 +1,54 @@ + + + + + + + + + IoT HTTPS Relay + + + + + + + + + +
+

IoT HTTPS Relay

+

+ An API that acts as a relay for IoT devices that do not support HTTPS i.e. you can use HTTPS APIs using HTTP +

+ + +

Fork me on GitHub

+ +

Twilio

+

+ Twilio is a voice and SMS(Text messaging) communication API. + You can use this API to call and send textmessages to phones from your IoT devices. +

+ +

Click on the links below to get started.

+ + +
+ + + + + + + diff --git a/twilio/Calls.php b/twilio/Calls.php new file mode 100644 index 0000000..0adb4e9 --- /dev/null +++ b/twilio/Calls.php @@ -0,0 +1,22 @@ +account->calls->create( + $from, + $to, + 'http://twimlets.com/echo?Twiml=%3CResponse%3E%3CSay%3E'.urlencode($body).'%3C%2FSay%3E%3C%2FResponse%3E' + +); + + +print $call->status; + diff --git a/twilio/Messages.php b/twilio/Messages.php index 54a9302..ecf0010 100644 --- a/twilio/Messages.php +++ b/twilio/Messages.php @@ -16,7 +16,7 @@ $body ); -print $message->sid; +print $message->status;