Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Move Rest API details to the top #18

Merged
merged 1 commit into from

2 participants

@kevinburke

I don't have any data, but my guess would be that someone just starting out with Twilio is going to send an SMS or a voice call first, so it makes sense to put the details about how to do that closest to the top of the readme.

The people who need to find out how to do a client capability token are probably a little more familiar/sophisticated with our API.

@andrewmbenton andrewmbenton merged commit a86a675 into twilio:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Oct 14, 2011
  1. move rest api details to top

    Kevin Burke authored
This page is out of date. Refresh to see the latest.
Showing with 63 additions and 63 deletions.
  1. +63 −63 README.md
View
126 README.md
@@ -16,68 +16,6 @@ $ rake gem
$ gem install pkg/twilio-ruby-{version}
```
-## Getting Started With Client Capability Tokens
-
-If you just need to generate a Capability Token for use with Twilio Client, you
-can do this:
-
-``` ruby
-require 'rubygems' # not necessary with ruby 1.9 but included for completeness
-require 'twilio-ruby'
-
-# put your own account credentials here:
-account_sid = 'AC043dcf9844e13758bc3a36a84c29761'
-auth_token = '62ea81de3a5b413254eb263595357c69'
-
-# set up
-capability = Twilio::Util::Capability.new account_sid, auth_token
-
-# allow outgoing calls to an application
-capability.allow_client_outgoing 'AP89a0180a1a4ddf1da954efca349b7a20'
-
-# allow incoming calls to 'andrew'
-capability.allow_client_incoming 'andrew'
-
-# generate the token string
-@token = capability.generate
-```
-
-There is a slightly more detailed document in the [Capability][capability]
-section of the wiki.
-
-## Getting Started With TwiML
-
-TwiML support is based on the [builder][builder] library. You can construct a
-TwiML response like this:
-
-``` ruby
-require 'rubygems' # not necessary with ruby 1.9 but included for completeness
-require 'twilio-ruby'
-
-# build up a response
-response = Twilio::TwiML::Response.new do |r|
- r.Say 'hello there', :voice => 'woman'
- r.Dial :callerId => '+14159992222' do |d|
- d.Client 'jenny'
- end
-end
-
-# print the result
-puts response.text
-```
-
-This will print the following (except for the whitespace):
-
-```
-<?xml version="1.0" encoding="UTF-8"?>
-<Response>
- <Say voice="woman">hello there</Say>
- <Dial callerId="+14159992222">
- <Client>jenny</Client>
- </Dial>
-</Response>
-```
-
## Getting Started With REST
### Setup Work
@@ -142,6 +80,68 @@ auth_token = '62ea81de3a5b414154eb263595357c69'
@client.account.incoming_phone_numbers.create(:phone_number => @number)
```
+## Getting Started With Client Capability Tokens
+
+If you just need to generate a Capability Token for use with Twilio Client, you
+can do this:
+
+``` ruby
+require 'rubygems' # not necessary with ruby 1.9 but included for completeness
+require 'twilio-ruby'
+
+# put your own account credentials here:
+account_sid = 'AC043dcf9844e13758bc3a36a84c29761'
+auth_token = '62ea81de3a5b413254eb263595357c69'
+
+# set up
+capability = Twilio::Util::Capability.new account_sid, auth_token
+
+# allow outgoing calls to an application
+capability.allow_client_outgoing 'AP89a0180a1a4ddf1da954efca349b7a20'
+
+# allow incoming calls to 'andrew'
+capability.allow_client_incoming 'andrew'
+
+# generate the token string
+@token = capability.generate
+```
+
+There is a slightly more detailed document in the [Capability][capability]
+section of the wiki.
+
+## Getting Started With TwiML
+
+TwiML support is based on the [builder][builder] library. You can construct a
+TwiML response like this:
+
+``` ruby
+require 'rubygems' # not necessary with ruby 1.9 but included for completeness
+require 'twilio-ruby'
+
+# build up a response
+response = Twilio::TwiML::Response.new do |r|
+ r.Say 'hello there', :voice => 'woman'
+ r.Dial :callerId => '+14159992222' do |d|
+ d.Client 'jenny'
+ end
+end
+
+# print the result
+puts response.text
+```
+
+This will print the following (except for the whitespace):
+
+```
+<?xml version="1.0" encoding="UTF-8"?>
+<Response>
+ <Say voice="woman">hello there</Say>
+ <Dial callerId="+14159992222">
+ <Client>jenny</Client>
+ </Dial>
+</Response>
+```
+
## More Information
There are more detailed examples in the included [examples.rb][examples].
@@ -155,4 +155,4 @@ for users of the old twiliolib gem, is available in the
[examples]:https://github.com/twilio/twilio-ruby/blob/master/examples.rb
[documentation]:https://github.com/twilio/twilio-ruby/wiki/Documentation
[upgrade]:https://github.com/twilio/twilio-ruby/wiki/UpgradeGuide
-[wiki]:https://github.com/twilio/twilio-ruby/wiki
+[wiki]:https://github.com/twilio/twilio-ruby/wiki
Something went wrong with that request. Please try again.