docs/usage/basics.rst in twilio-ruby-3.11.0 vs docs/usage/basics.rst in twilio-ruby-3.11.1
- old
+ new
@@ -3,16 +3,16 @@
=========================
Accessing REST Resources
=========================
To access Twilio REST resources, you'll first need to instantiate a
-:class:`TwilioRestClient`.
+:class:`Twilio::REST::Client`.
Authentication
--------------------------
-The :class:`TwilioRestClient` needs your Twilio credentials. To get
+The :class:`Twilio::REST::Client` needs your Twilio credentials. To get
your credentials, visit `your Twilio account portal
<https://www.twilio.com/user/account>`_. If you don't have a Twilio account
yet, go `here <https://www.twilio.com/try-twilio>`_ to get started.
Once you have your credentials, you can create create a new :class:`Client` and get started.
@@ -41,25 +41,25 @@
# To find these visit https://www.twilio.com/user/account
account_sid = "ACXXXXXXXXXXXXXXXXX"
auth_token = "YYYYYYYYYYYYYYYYYY"
@client = Twilio::REST::Client.new account_sid, auth_token
- @calls = client.calls.list()
+ @calls = @client.account.calls.list()
:meth:`ListResource.list` accepts paging arguments.
The following will return page 3 with page size of 25.
-.. code-block:: python
+.. code-block:: ruby
require 'twilio-ruby'
# To find these visit https://www.twilio.com/user/account
account_sid = "ACXXXXXXXXXXXXXXXXX"
auth_token = "YYYYYYYYYYYYYYYYYY"
@client = Twilio::REST::Client.new account_sid, auth_token
- @calls = client.calls.list(page=3, page_size=25)
+ @calls = @client.account.calls.list(:page=>3, :page_size=>25)
Get an Individual Resource
-----------------------------
@@ -74,8 +74,8 @@
account_sid = "ACXXXXXXXXXXXXXXXXX"
auth_token = "YYYYYYYYYYYYYYYYYY"
@client = Twilio::REST::Client.new account_sid, auth_token
- @call = @client.calls.get("CA123")
+ @call = @client.account.calls.get("CA123")
puts @call.to