Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'master' of github.com:twilio/workshop

  • Loading branch information...
commit 75a32d5dda67019ddc19a4c1822e2fbaa035c4ea 2 parents 3a00a82 + a9974d5
@kyleconroy kyleconroy authored
View
BIN  docs/_static/api_explorer.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  docs/_static/recording.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  docs/_static/startapp.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
18 docs/browser.rst
@@ -82,7 +82,7 @@ rendering templates on AppEngine. Those are imported from ``util.py``.
.. code-block:: python
- from util import gen_token, render_template
+ from util import generate_token, render_template
class IndexPage(webapp2.RequestHandler):
@@ -235,7 +235,7 @@ Now we just need to add another button to trigger the hangup.
.. code-block:: html
- <button class="next" onclick="next();">
+ <button class="hangup" onclick="next();">
Next Caller
</button>
@@ -253,11 +253,19 @@ JSON.
class QueueStatusPage(webapp2.RequestHandler):
- queue_sid = "QQ123"
def get(self):
client = TwilioRestClient(ACCOUNT_SID, AUTH_TOKEN)
- q_data = {"queues": client.queues.get(queue_sid)}
- self.response.out.write(json.dumps(q_data))
+
+ queue = [x for x in client.queues.list() if x.friendly_name == 'radio-callin-queue']
+
+ if queue:
+ q_data = {
+ "current_size": queue[0].current_size,
+ 'average_wait_time': queue[0].average_wait_time,
+ }
+ self.response.out.write(json.dumps(q_data))
+ else:
+ self.abort(404)
Add this QueueStatusPage into the WSGIApplication's routing map as
View
30 docs/custom_twiml.rst
@@ -6,7 +6,7 @@ Introduction to TwiML
We've successfully made a phone ring, but how do we actually control call flow?
`TwiML <https://www.twilio.com/docs/api/twiml>`_ is the
answer. TwiML is a set of instructions you can use to tell Twilio what to do
-when you receive an incoming call or SMS.
+when you receive an incoming call or SMS. TwiML instructions are formatted in XML and are case sensitive.
When someone makes a call or sends an SMS to one of your Twilio numbers, Twilio
will look up the URL associated with that phone number and make a request to
@@ -29,31 +29,29 @@ And one basic verb for SMS messaging.
To see how these verbs work, let's first take a look at the last section. When we
called your phone, a robot answered with a "Hello World" message. We now know
that TwiML powered that call, so let's take a look. Open
-http://twimlets.com/message?Message[0]=Hello+World in your browser.
+http://twimlets.com/message?Message=Hello+World in your browser.
-.. code-block:: xml
-
- <?xml version="1.0" encoding="UTF-8"?>
- <Response><Say>Hello World</Say></Response>
-
-This TwiML uses the `Say`_ verb and says "Hello World" with a text-to-speech
-engine. For outgoing calls, we choose the TwiML URL at the time of the call.
-For incoming calls, we set a TwiML URL that is fetched each time someone calls
-into your Twilio number.
+Notice the TwiML used for this application. This application uses the `Say`_ verb
+and says "Hello World" with a text-to-speech engine. For outgoing calls, we choose
+the TwiML URL at the time of the call. For incoming calls, we set a TwiML URL that
+is fetched each time someone calls into your Twilio number.
Twimlbin
----------
TwiML can be hosted anywhere. It can be a static XML document or created
dynamically by a web application. To make developing Twilio applications
-easier, you can host your TwiML on `Twimlbin`_.
+easier, you can host your TwiML on `Twimlbin`_. Applications with Twimlbin
+will autosave and let you know when there might be potential errors with
+your TwiML. While we love Twimlbin, we recommend that you host your Twilio
+production application on your own server.
Let's rebuild the "Hello World" greeting in `Twimlbin`_.
To create a new bin, go to the Twimlbin homepage and click "Create a new
Twimlbin".
-Now let's write our "Hello World" application.
+Now let's write our "Hello World" application with the following code.
.. code-block:: xml
@@ -71,7 +69,7 @@ Configuring your phone number
------------------------------
Once you're done building your application, we'll want to configure your Twilio
-phone number. By configuring our Twilio phone number, whenever an incoming call
+phone number. By configuring the Twilio phone number, whenever an incoming call
is received on this number, Twilio will fetch the TwiML that is located at that
URL.
@@ -123,8 +121,8 @@ and paste the following TwiML into your Twimlbin.
This TwiML is invalid. We open the Response and never close it.
-Call your phone number. You should hear a recorded message that says "We're
-sorry, an application error has occurred".
+Call your phone number. Do you hear application recorded message that says "We're
+sorry, an application error has occurred"?
Now let's find out why your application error has occurred. The first place
we'll want to look is the `debugger
View
169 docs/dynamic_apps.rst
@@ -13,14 +13,14 @@ SDK running locally on your computer.
Your first web application
--------------------------
-The first part of the guide walked you through running a sample application.
-Before continuing, make sure that app is running and you have "Hello World"
+The first part of this guide walks you through running a sample application.
+Before continuing, make sure your "Hello World" app is running and you have "Hello World"
displayed in your browser. If you can't remember how to run the sample app,
refer back to :ref:`setup`.
-Before we can write our web application, we need to understand the Hello World
-example. Let's go through the example line-by-line and how it works. Inside our
+Before we write our dynamic Twilio application, let's first understand the "Hello World"
+example. Let's go through the example line-by-line and see how it works. Inside our
``main.py`` file:
.. literalinclude:: ../main.py
@@ -29,30 +29,29 @@ example. Let's go through the example line-by-line and how it works. Inside our
This line is the first part of our application. We use the `webapp2
-<http://webapp-improved.appspot.com/>`_ Python module to create our web application,
-so we must do an import before we can use it in our code.
+<http://webapp-improved.appspot.com/>`_ Python module to create our web application.
+Before we can use it in our application, we must first import it.
.. literalinclude:: ../main.py
:language: python
:lines: 3-6
-This code handles incoming requests to our application at the specified URL.
Whenever a user makes a request to our application, this is the code that
-will be run. The output of the code gets displayed to the web browser.
+will be run. The output of the code gets displayed to the web browser. We will name
+this block of code "HelloWorld". The name of a block of code is called the `RequestHandler`.
-Here we only define a single method on the class called ``get``. If you
-remember your HTTP verbs from the :ref:`http` section, this method name
-corresponds to an HTTP GET. We'll show later how to handle different HTTP
-verbs, such as POST or DELETE.
+We are also making a request called ``get``, which grabs the requested resource.
+This corresponds to the HTTP GET request. If you'd like to learn more about HTTP,
+the language browsers use to talk to servers, take a look at our :ref:`http` section.
.. literalinclude:: ../main.py
:language: python
:lines: 8-
-Here we actually create our application. In the `webapp2` framework web
-applications are a mapping of URLs to request handler classes. The above
-mapping says "Whenever someone visits the front page of my application
-(the ``/`` url), process that request using the HelloWorld request handler class".
+In this part of our code, we create our application using the `webapp2` framework.
+The web applications is a mapping of the URL we specify with the listed request handler.
+The above mapping says "Whenever someone visits the front page of my application
+(the ``/`` url), process that request using the HelloWorld request handler".
Your first task will be to change the message displayed in your browser. Open
up ``main.py`` in your text editor and change the "Hello World" message on line
@@ -83,12 +82,14 @@ message we respond with to valid TwiML.
], debug=True)
When someone requests the front page of our application, they will now get TwiML
-instead of HTML. However, if you refresh your page, nothing seems to have
+instead of HTML. If you refresh your page, nothing seems to have
changed.
-The problem is that while we're sending back TwiML, the browser still
-thinks we're sending it HTML. To fix this problem we'll include additional
-metadata via an HTTP header to tell the browser we're sending valid TwiML.
+The problem is that while we're sending back TwiML, the browser still thinks we're
+sending it HTML. Since we never tell the browser that we are sending XML, which is
+the format of TwiML, it assumes that we are using HTML. To fix this problem we'll
+include additional metadata via an HTTP header to tell the browser we're sending
+valid TwiML.
.. code-block:: python
:emphasize-lines: 6
@@ -105,7 +106,7 @@ metadata via an HTTP header to tell the browser we're sending valid TwiML.
('/', HelloWorld),
], debug=True)
-When you refresh the page, you should now see the entire TwiML response (and it
+When you refresh the page, you should now see the entire TwiML response, (it
may even be highlighted and formatted).
@@ -115,7 +116,8 @@ Using the Twilio Helper Library
Manually writing TwiML soon becomes very tiresome. If you miss a single ending
tag, your entire application can break. Instead, we'll use the ``twilio-python``
helper library to generate TwiML for us. This way we won't have to worry about
-messing up the syntax.
+messing up the syntax. To use the ``twilio-python`` helper library, we'll import
+it from Twilio with the code ``from twilio import twiml`` in line 2.
.. code-block:: python
:emphasize-lines: 2, 9-11
@@ -145,42 +147,87 @@ explain what the added code is actually doing.
response = twiml.Response()
-Here we create a new Response object. We'll add additional TwiML verbs using
-methods on this object. We also use this object to output our TwiML into a
-string.
+Here we create a new Response object. Every Twilio application must begin with the
+Response TwiML. We'll add additional TwiML verbs and nest them within the Response
+TwiML.
.. code-block:: python
response.say("Hello TwilioCon")
-This methods adds a Say verb to the response. There are similar methods on the
-response object for Play, Gather, Record, and Dial. We've already covered these
-verbs in the previous sections.
+This methods adds a Say verb to the Response object. The other TwiML verbs Play, Gather,
+Record, and Dial may also be used as methods on Response.
.. code-block:: python
self.response.write(str(response))
-Here we turn our response object into a string using Python's built in string
-function. We then write this string to the response object.
+Here we turn our response code into a string using Python's built in string
+function. This will write a string to the response object and return a response to Twilio.
The Weather Channel
-------------------
-So far all our responses look the same. We're just returning static TwiML as we
-did that the last two sessions. Now we're about to show you why building a
-dynamic application is so powerful. Instead of simply reading a message, we'll
-inform the caller of the current weather in his or her zipcode.
+So far all our responses look the same. We're just returning static TwiML with the same
+message. Now let's build a dynamic application that interacts with your inputs. How about building
+"Weather Channel"! Instead of simply reading a message, we'll inform the caller of the
+current weather in his or her zipcode.
-.. note::
+To begin, we need data on the weather. Let's import the weather data from Yahoo! Weather API, ``from util import current_weather``.
+Insert this code in line 2 right before we import our helper library.
+
+Now that we have data on the weather, let's make sure our application can get the current weather of a particular zipcode. Use the following code ``weather = current_weather("94117")`` so that we can get the weather from San Francisco's area code 94117. Let's also include the city so we can acknowledge to our callers where they are getting their weather from, ``city = "San Francisco"``.
- The zipcode information Twilio passes to our application is the zipcode of
- the caller's phone number, not to be confused with the zipcode of live
- location of the caller themselves.
+Finally, let's add our TwiML and so Twilio knows how to respond to the caller. In the end your application should look like this:
.. code-block:: python
:emphasize-lines: 2,10,11,14,15
+ import webapp2
+ from util import current_weather
+ from twilio import twiml
+
+ class HelloWorld(webapp2.RequestHandler):
+
+ def get(self):
+ self.response.headers['Content-Type'] = "application/xml"
+
+ weather = current_weather("94117")
+ city = "San Francisco"
+
+ response = twiml.Response()
+ response.say("Hello from " + city)
+ response.say("The current weather is " + weather)
+ self.response.write(str(response))
+
+ app = webapp2.WSGIApplication([
+ ('/', HelloWorld),
+ ], debug=True)
+
+
+When you visit your localhost:8080 page. You'll see the following message.
+
+.. code-block:: xml
+
+ <?xml version="1.0" encoding="UTF-8"?>
+ <Response>
+ <Say>Hello from San Francisco</Say>
+ <Say>The current weather is Partly Cloudy, 65 degrees</Say>
+ </Response>
+
+
+Let's revisit our application. Right now our application only gets the weather for San Francisco
+for the zipcode 94117.
+
+Phone numbers contain a lot of data though. By using the phone number of your caller, Twilio can pass the zipcode
+and city information to your application. Twilio labels this information "FromZip" and "FromCity".
+Instead of just getting the weather for San Francisco, let's make this application
+more relevent to your caller and use this data. Keep in mind, this isn't actually
+the zipcode of the caller's live location though.
+
+.. code-block:: python
+ :emphasize-lines: 8,9
+
import webapp2
from util import current_weather
from twilio import twiml
@@ -203,18 +250,7 @@ inform the caller of the current weather in his or her zipcode.
], debug=True)
-Now visit your page. You'll see the following message.
-
-.. code-block:: xml
-
- <?xml version="1.0" encoding="UTF-8"?>
- <Response>
- <Say>Hello from San Francisco</Say>
- <Say>The current weather is Partly Cloudy, 65 degrees</Say>
- </Response>
-
-
-Our city defaults to San Francisco in case we can't find your zipcode or city.
+In the case we can't find your zipcode or city, your application will default back to providing the weather of San Francisco.
To test out the greeting, add the ``FromZip`` and ``FromCity`` parameter to your URL.
.. code-block:: bash
@@ -245,7 +281,7 @@ Incoming Twilio Data
Adding this parameter to your URL mimics the request that Twilio will send to
your server. All TwiML requests made by Twilio include additional information
about the caller. Here is short list of some of the data that Twilio will send
-your way.
+to your server with every call.
=============== ===========
Parameter Description
@@ -259,7 +295,7 @@ Parameter Description
``FromCountry`` The country of the caller.
=============== ===========
-Phone numbers are formatted in E164 format (with a '+' and country code, e.g.
+Phone numbers are formatted in E164 format (with a '+' and the country code, e.g.
`+1617555121`).
For a complete list, check out `Twilio request parameters
@@ -269,7 +305,7 @@ on the Twilio Docs.
Handling Server Errors
--------------------------------------------
-Sometimes, errors happen on the web application side of the code.
+Sometimes, errors will occur on the web application side of the code.
.. image:: _static/app_error.png
@@ -287,7 +323,7 @@ Deploy your Twilio application
------------------------------
We're now ready to hook up your brand new application to a Twilio number. To do this,
-we'll need to host your application live on the Internet, so that Twilio can find it!
+we'll need to host your application live on the Internet, so that Twilio can access it!
Open the Google App Engine Launcher application, highlight your application, and hit
the "Deploy" button. A window will pop up and show you the status of your
@@ -295,7 +331,7 @@ deployment. It should take less than a minute to deploy.
.. image:: _static/deployapp.png
-Once it's deployed, take the URL for your application,
+Once it's deployed, copy the URL for your application,
``http://<your-application-name>.appspot.com`` and set it as the voice number
for your Twilio phone number. Configuring Twilio numbers is covered in more
detail in :ref:`configure-number`.
@@ -312,7 +348,9 @@ Gathering Digits From the Caller
Since not everyone's phone number is from the location they currently live,
it may be helpful to add a feature to our app for checking the weather of
-any zipcode. To achieve this, we're going to use a TwiML verb called `<Gather>
+any zipcode. This allows us to interact with our application.
+
+To achieve this, we're going to use a TwiML verb called `<Gather>
<http://www.twilio.com/docs/api/twiml/gather>`_.
Let's begin by adding a ``<Gather>`` menu:
@@ -349,11 +387,11 @@ The TwiML we've generated so far for the menu looks like this:
</Response>
We now have a ``<Gather>`` verb which will allow the caller to type in exactly 1 digit
-(because of the attribute ``maxDigits``). Next, we need to hook it up to something that
+(because of the attribute ``numDigits``). Next, we need to hook it up to something that
can process the input based on which digits were pressed. When we use ``<Gather>``, these
-digits are passed to us in the next callback using the parameter ``Digits``.
+digits are passed to your application in the next callback using the parameter ``Digits``.
-Lets add some additional code to be able to handle this callback.
+Let's add some additional code to handle this callback.
.. code-block:: python
:emphasize-lines: 12,17-29
@@ -393,19 +431,22 @@ Lets add some additional code to be able to handle this callback.
], debug=True)
-First, we've specified that the action of the ``<Gather>`` should be an HTTP ``POST``. Next, we
-added some code to our ``webapp2.RequestHandler`` to respond to a ``POST`` request.
+First, we've specified that the action of the ``<Gather>`` should be an HTTP ``POST``.
+
+Next, we added some code to our ``webapp2.RequestHandler`` to respond to a ``POST`` request.
Because our first ``<Gather>`` specifies a ``POST`` method and no ``action``, the default
``action`` is the current URL (In this case, "/"). So, this code is what will get run
after the first ``<Gather>``.
We pull the value ``digit_pressed`` from ``self.request.get("Digits")`` which corresponds to what
-the caller pressed. In the case that the ``digit_pressed`` was ``"1"``, the behavior looks quite
+the caller pressed.
+
+In the case that the ``digit_pressed`` was ``"1"``, the behavior looks quite
similar to our earlier example. We then redirect the user back to the beginning to the menu, so they
can try again.
-If the caller presses 2, we ask them for 5 more digits. However, we don't yet have the logic to process
-what to do with these 5 more digits, so nothing interesting will happen when they finish entering.
+If the caller presses 2, we ask them for 5 more digits. We don't yet have the logic to process
+what to do with these 5 more digits, so nothing interesting will happen when they finish entering these digits.
.. note::
View
39 docs/hello_world.rst
@@ -9,15 +9,15 @@ see how SMS and phone calls can be originated from your web browser with Twilio.
Twilio Account Portal
---------------------
-When you log into your Twilio Account, the first page you will come across is
-your Account Dashboard. This is where your Account SID and Auth Token are
+When you log into your Twilio Account, the first page you come across is
+your Account Dashboard. This is where your Account Sid and Auth Token are
displayed.
.. image:: _static/bar.png
:class: screenshot
-These are your account credentials. The Account SID acts as a username and the
-Auth Token acts as a password. Twilio uses your Account SID and Auth Token to
+These are your account credentials. The Account Sid acts as a username and the
+Auth Token acts as a password. Twilio uses your Account Sid and Auth Token to
authenticate the API requests made by your application.
Analytics about your Voice and SMS application are also shown here. We'll go
@@ -28,9 +28,12 @@ At the bottom of your Account Dashboard is the API Explorer and the Debugger.
Twilio API Explorer
-------------------
-The `API Explorer`_ is a helpful application built into the Account Portal that allows you to easily try out the API without getting into the details of scripting and :ref:`HTTP <http>` calls.
+The `API Explorer`_ is a helpful application built into the Account Dashboard that allows you to easily try out Twilio's API without getting into the details of scripting and :ref:`HTTP <http>` calls.
-Let's use the `API Explorer`_ to get to know the Twilio API.
+You can get to the `API Explorer`_ from the botton of your Account Dashboard. You may also click on the `Dev Tools <https://www.twilio.com/user/account/developer-tools/api-explorer>`_ tab to access the API Explorer.
+
+.. image:: _static/api_explorer.png
+ :class: screenshot
Getting Account Information
^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -59,9 +62,7 @@ Let's take a look at the key parts of the request we just made:
GET /2010-04-01/Accounts/AC000.xml
-This command is specially formatted to function on the command line. Lets break that down a bit:
-
-- **GET**: this line tells curl to make a ``GET`` request, meaning that the intent of this call is to retrieve information from the server.
+- **GET**: this is the type of request to make, a ``GET`` request, meaning that the intent of this call is to retrieve information from the server.
- **/2010-04-01/Accounts/AC000.xml**: this is the endpoint for retrieving Account data from the Twilio API. Lets break it down further:
- **/2010-04-01/** is the version of the API that we want to request. The version of the API we want to talk to is important because we want to make sure that the way we talk to the API doesn't change. If Twilio makes a major change to how to talk to the API the version will change, but the old version will continue to work the same way so that your application doesn't break.
- **Accounts/AC000.xml** means that we want to retrieve an Account resource for the account "AC000" and that we want the response in XML format.
@@ -76,19 +77,19 @@ Let's send a text message using the `API Explorer`_. Go to your Twilio `Account
.. image:: _static/explore-sms.png
:class: screenshot
-Here we can try out the Twilio API for sending SMS Messages. All the fields required to send an SMS are visible. This request will add 2 new parameters to the request:
+Here we can try out the Twilio API for sending SMS Messages. All the fields required to send an SMS are visible. This request will add 2 new parameters:
============ ==========
Parameter Definition
============ ==========
`From` The `From` field tells the API which phone number to use to send the Message. This can only be one of the phone numbers you've purchased or ported into Twilio.
-`To` The `To` field tells the API where to send the message. The phone number should be in `E.164`_ format. Phone numbers that do not include a "+" with country code will be assumed to be from the same country as the `From` phone number.
+`To` The `To` field tells the API where to send the message. The phone number should be in `E.164`_ format. Twilio will assume that `To` phone numbers without a "+" will have the same country code as the `From` phone number.
`Body` The body is a freeform field to enter your message. You can enter a message up to 160 characters long.
============ ==========
-Enter your cell phone number in the `To` field along with a text message `Body`, and click the `Make Request` button at the bottom of the page. This will send an SMS. You may be prompted to confirm the use of funds from your account. Aren't you glad you got the Promo credit?
+Enter your cell phone number in the `To` field along with a text message `Body`, and click the `Make Request` button at the bottom of the page. This will send the information you've just entered to the Twilio API. You will be prompted to confirm the use of funds from your account. Aren't you glad you got the Promo credit?
-Your phone should receive a text message shortly.
+Twilio will process the information you have submitted and your phone will receive a text message shortly.
**So how was that different from our Accounts information request?**
@@ -100,7 +101,7 @@ Lets take a look at the key parts of this request:
There are a few key differences to note:
-- **POST** tells curl to make a ``POST`` request, meaning that the purpose of this request is to pass data in to the API for the purposes of modifying the ``SMS Messages`` resource.
+- **POST** this time we're making a ``POST`` request, meaning that the purpose of this request is to pass data in to the API for the purposes of modifying the ``SMS Messages`` resource.
- **Parameters**: if you look at the `Code Example` right above the `Make Request` button you see **-d 'From=xxx'*** et al... these tell curl what data to pass to the API. You can see each entry you modified in the form is represented here. You'll also notice that each entry contains special characters (ie: ``%2B`` instead of ``+``). This is called `Url Encoding`_ and is required to make sure that special characters are properly transmitted to the API.
Now lets examine the response. You'll see that the message was given a `Sid`, a unique identifier, how Twilio interpreted the information you sent, and you can see that it was queued for delivery.
@@ -112,7 +113,7 @@ Now click on `Make Request` to see the current status of the message. You can se
Making a Phone Call
^^^^^^^^^^^^^^^^^^^
-Now let's make a phone call using the `API Explorer`_. Go to your Twilio `Account Portal`_, click on `Dev Tools`, then click on `Phone Calls`, then on `Make call`.
+Now let's make a phone call using the `API Explorer`_. Click on the Calls link on the left hand sidebar, then on the sublink `"Make call" <https://www.twilio.com/user/account/developer-tools/api-explorer#POST/2010-04-01/Accounts/[AccountSid]/Calls.[format]>`_.
.. image:: _static/explore-call.png
:class: screenshot
@@ -125,13 +126,13 @@ Parameter Definition
`Url` The `Url` field tells the API where to load TwiML instructions for handling the call. `TwiML`_ is a set of instructions that tells Twilio what to do. Don't worry, we'll get more into TwiML later.
============ ==========
-Enter your cell phone number in the `To` field. To make things easy, we're going to use a `Twimlet`_ for the `Url`. We'll get into the details of building TwiML later on. Copy the url below into the `Url` field.
+Enter your cell phone number in the `To` field. To make things easy, we're going to use a `Twimlet`_ for the `Url`. We'll get into the details of building TwiML later on. For now, copy the url below into the `Url` field.
.. code-block:: bash
http://twimlets.com/message?Message=Hello+World
-Click on the `Make Request` button at the bottom of the page. Your phone should start ringing momentarily.
+Click on the `Make Request` button at the bottom of the page. Again, the information you've submitted is sent off to Twilio and your phone should start ringing momentarily.
**How was that different from our SMS request?**
@@ -139,10 +140,12 @@ In this request we replaced the `Body` parameter with a `Url` parameter. The url
If you load the Url we supplied directly in to a web browser you can see the TwiML that was used to handle the phone call. Don't worry about understanding it right now, we'll get in to that in the next section.
-If you examine the response you'll notice it looks much like the response we got from sending the SMS, but with a few different values. Click on the `Sid` in the response to be taken to a page where we can request call details.
+If you examine the API response you'll notice it looks much like the response we got from sending the SMS, but with a few different values. Click on the `Sid` in the response to be taken to a page where we can request call details.
Click on `Make Request` to see the details on the completed call.
+**Have any questions? Ask your TA!**
+
Additional Information
----------------------
- `TwiML: the Twilio Markup Language <http://www.twilio.com/docs/api/twiml>`_
View
11 docs/http.rst
@@ -7,8 +7,7 @@ Introduction to HTTP
When a web browser requests a web page it needs to talk to a web server.
Browsers talk to servers using a language known as HTTP, or Hypertext Transfer
-Protocol. The language is simple and easy to understand and this
-request/response model of communication is referred to as REST, or
+Protocol. This request/response model of communication is referred to as REST, or
`REpresentational State Transfer`.
A simple HTTP request might look like:
@@ -28,9 +27,11 @@ And the server response would be:
Response body appears here…
The response is comprised of a header block and a content block. The ``Content
-Type`` header tells the browser how to interpret the response. If it had been
-``image/png`` the browser would have known to expect PNG data, or in the case
-of ``application/json`` it would have expected a JSON formatted data response.
+Type`` header tells the browser how to interpret the response. If the header
+includes ``image/png`` the browser expects PNG data, or in the case
+of ``application/xml`` it will expect a XML formatted data response.
+
+
HTTP Headers
------------
View
18 docs/setup.rst
@@ -127,12 +127,13 @@ browser window.
.. image:: _static/browseapp.png
-Your browser will open and you'll see "Hello World!" on screen. Let's take a
-moment and look at the URL that is loaded in your browser. The URL says
-``http://localhost:8080/``. `localhost` is a special URL that tells the browser
-to make a request to your local computer instead of out to the internet. The
-``:8080`` portion tells the browser to make the request to port 8080. This URL
-is not visible from the internet and, in general, is only visible to you.
+Your browser will open with the text "Hello World!" on your screen. Let's take a
+moment and look at the URL that is loaded in your browser.
+
+The URL says ``http://localhost:8080/``. `localhost` is a special URL that tells
+the browser to make a request to your local computer instead of out to the internet.
+The ``:8080`` portion tells the browser to make the request to port 8080. This URL
+is not visible and accessible from the internet and, in general, is only visible to you.
.. note::
@@ -169,7 +170,7 @@ Deploy your Application
~~~~~~~~~~~~~~~~~~~~~~~
It's now time to share your application with the world. To deploy your application on
-App Engine, you'll need to create an application via your App Engine dashboard
+App Engine, we'll need to create an application via your App Engine dashboard
(which requires a Google account).
Open the `App Engine dashboard <http://appengine.google.com>`_ in a new tab and
@@ -204,7 +205,8 @@ the application name you registered and save the file.
Open the **Google App Engine Launcher**, highlight your application if it is not
already highlighted, and then click the "Deploy" button. The Launcher app will
-upload your code and deploy it.
+upload your code and deploy it. Your application t is now publicly accessible
+through the internet.
.. image:: _static/deployapp.png
View
52 docs/static_apps.rst
@@ -31,28 +31,14 @@ Find this call in your `Call Logs
<https://www.twilio.com/user/account/log/calls>`_. You should notice two call
records listed. What's the difference between the two call records?
-Direction
-`````````
+**Direction**
+ For applications like Call Forwarding, your call will include two call legs. The inbound call leg noted under *Incoming* is the call made into Twilio. The outbound call leg noted under *Outgoing Dial* is the call made from Twilio with the Dial verb out to another phone number. Call Forwarding applications include both an inbound leg and an outbound leg.
-For applications like Call Forwarding, your call will include two call legs.
-The inbound call leg noted under *Incoming* is the call made into Twilio. The
-outbound call leg noted under *Outgoing Dial* is the call made from Twilio with
-the Dial verb out to another phone number. Call Forwarding applications include
-both an inbound leg and an outbound leg.
+**Cost**
+ The cost of inbound and outbound calls are different. Inbound calls cost 1¢ per minute while outbound calls start at 2¢ per minute. The cost of outbound calls may also differ depending on the end destination of your outbound call. See the `Voice Pricing`_ page for more pricing information.
-Cost
-````
-
-The cost of inbound and outbound calls are different. Inbound calls cost 1¢ per
-minute while outbound calls start at 2¢ per minute. The cost of outbound calls
-may also differ depending on the end destination of your outbound call. See the
-`Voice Pricing`_ page for more pricing information.
-
-To
-``
-
-While the "From" phone numbers are the same, the "To" phone number are
-different based on the phone number receiving your call.
+**To**
+ While the "From" phone numbers are the same, the "To" phone number are different based on the phone number receiving your call.
Introducing Attributes
------------------------
@@ -60,26 +46,25 @@ Introducing Attributes
Each TwiML verb and noun has a set of attributes that allow you to modify its
behavior. Let's change our robot voice to a female voice by adding the `voice
attribute <http://www.twilio.com/docs/api/twiml/say#attributes-voice>`_ and
-setting it to "woman". Additionally, let's record our call by including the
-`record attribute
+setting it to "woman" like so, ``<Say voice="woman">``. Additionally, let's
+record our call by including the `record attribute
<http://www.twilio.com/docs/api/twiml/dial#attributes-record>`_ and mark that
-as "true".
+as "true", ``<Dial record="true"``.
For our last call, the caller ID displayed was the phone number where the call
originated from. Let's change your caller ID using the `callerId attribute
<http://www.twilio.com/docs/api/twiml/dial#attributes-caller-id>`_ so that it
-displays your Twilio phone number instead.
+displays your Twilio phone number instead, ``<Dial callerId="YOUR TWILIO PHONE NUMBER">``.
-
-Note: earlier, we verified your personal phone number, so you may also use that
-as your caller ID. You can
-`verify other numbers <https://www.twilio.com/user/account/phone-numbers/verified>`_
-in your Twilio account to use them as caller IDs.
+Earlier we verified your personal phone number so you may also use that as your
+caller ID. To use other phone numbers as your caller ID you can `verify those
+numbers <https://www.twilio.com/user/account/phone-numbers/verified>`_ in your Twilio Account.
Test out the following code and see how the attributes have changed your
application.
.. code-block:: xml
+ :emphasize-lines: 3-4
<?xml version="1.0" encoding="UTF-8"?>
<Response>
@@ -89,7 +74,7 @@ application.
</Dial>
</Response>
-Try out some of the other `Say`_ verb and `Dial`_ verb attributes and see what
+Now try out some the `Say`_ verb and `Dial`_ verb attributes and see what
they do.
Voice Mailbox
@@ -114,8 +99,10 @@ recording right after your done. Head to your `recordings log
<https://www.twilio.com/user/account/log/recordings>`_ to listen to your
message.
-Transcription
-~~~~~~~~~~~~~~
+To delete your recording through the User Interface, click on the date of the
+recording. There's a "Delete Recording" link at the bottom right hand corner.
+
+.. image:: _static/recording.png
Transcriptions of your recordings can also be made by Twilio with the
`transcribe attribute
@@ -135,7 +122,6 @@ Head over to your `transcription log
<https://www.twilio.com/user/account/log/transcriptions>`_ to see your
transcription and listen to your message.
-
Private Conference Line
-----------------------
Please sign in to comment.
Something went wrong with that request. Please try again.