8000 Merge branch 'master' into tty · Web5design/twilio-python@2751252 · GitHub
[go: up one dir, main page]

Skip to content

Commit 2751252

Browse files
author
Doug Black
committed
Merge branch 'master' into tty
2 parents 3f722e8 + bba64f2 commit 2751252

37 files changed

+394
-381
lines changed

AUTHORS.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ We'd like to thank the following people who have contributed to the
1111
- Comrade DOS <dos@hidevlab.com>
1212
- Dan Yang <dsyang92@gmail.com>
1313
- Dennis Pilarinos <dennispi@gmail.com>
14+
- Doug Black <dblack@gmail.com>
1415
- Fabian Topfstedt <topfstedt@schneevonmorgen.com>
1516
- Florian Le Goff <florian@9h37.fr>
1617
- Frank Tobia <frank.tobia@gmail.com>
@@ -25,11 +26,12 @@ We'd like to thank the following people who have contributed to the
2526
- Michael Parker <michael.g.parker@gmail.com>
2627
- Moses Palmér <moses@blockmastersecurity.com>
2728
- Ryan Horn <ryanhorn@twilio.com>
29+
- Sam Kimbrel <skimbrel@twilio.com>
2830
- Skylar Saveland <skylar.saveland@gmail.com>
2931
- Tiberiu Ana <tiberiu@tiberiuana.com>
3032
- Zachary Voase <z@zacharyvoase.com>
3133
- aes <alan@you-compete.com>
3234
- dnathe4th <dnathe4th@gmail.com>
3335
- isbo <jrandh@gmail.com>
3436
- negeorge <negeorge@gmail.com>
35-
- Evan Cooke
37+
- Evan Cooke

CHANGES.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,24 @@ twilio-python Changelog
33

44
Here you can see the full list of changes between each twilio-python release.
55

6+
Version 3.6.2
7+
------------
8+
9+
Released on September 24, 2013
10+
11+
- Adds support for HTTP and SOCKS4/5 proxies to the REST client.
12+
13+
14+
Version 3.6.0, 3.6.1
15+
--------------------
16+
17+
Released on September 18, 2013
18+
19+
- Adds support for the new Message and SIP resources to the REST
20+
API client.
21+
- Adds support for the new Message verb to the TwiML generator.
22+
23+
624
Version 3.5.3, 3.5.4
725
--------------------
826

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@ account = "ACXXXXXXXXXXXXXXXXX"
6969
token = "YYYYYYYYYYYYYYYYYY"
7070
client = TwilioRestClient(account, token)
7171

72-
call = client.calls.create(to="9991231234",
73-
from_="9991231234",
72+
call = client.calls.create(to="9991231234",
73+
from_="9991231234",
7474
url="http://twimlets.com/holdmusic?Bucket=com.twilio.music.ambient")
7575
print call.sid
7676
```
@@ -84,8 +84,8 @@ account = "ACXXXXXXXXXXXXXXXXX"
8484
token = "YYYYYYYYYYYYYYYYYY"
8585
client = TwilioRestClient(account, token)
8686

87-
message = client.sms.messages.create(to="+12316851234", from_="+15555555555",
88-
body="Hello there!")
87+
message = client.messages.create(to="+12316851234", from_="+15555555555",
88+
body="Hello there!")
8989
```
9090

9191
### Handling a call using TwiML
@@ -115,7 +115,7 @@ Python library documentation") explains all the awesome features available to
115115
use.
116116

117117
* [Retrieve Call Records][calls]
118-
* [Retrieve SMS Message Records][sms-messages]
118+
* [Retrieve Message Records][messages]
119119
* [Search for a Phone Number][number]
120120
* [Buy a Number][number]
121121
* [Validate a Phone Number][validate]
@@ -124,5 +124,5 @@ use.
124124
[number]: http://twilio-python.readthedocs.org/en/latest/usage/phone-numbers.html#searching-and-buying-a-number
125125
[validate]: http://twilio-python.readthedocs.org/en/latest/usage/caller-ids.html
126126
[recordings]: http://twilio-python.readthedocs.org/en/latest/usage/recordings.html#listing-your-recordings
127-
[sms-messages]: http://twilio-python.readthedocs.org/en/latest/usage/messages.html#retrieving-sent-messages
127+
[messages]: http://twilio-python.readthedocs.org/en/latest/usage/messages.html#retrieving-sent-messages
128128
[calls]: http://twilio-python.readthedocs.org/en/latest/usage/phone-calls.html#retrieve-a-call-record

docs/conf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,9 @@
5757
# built documents.
5858
#
5959
# The short X.Y version.
60-
version = '3.5'
60+
version = '3.6'
6161
# The full version, including alpha/beta/rc tags.
62-
release = '3.5.4'
62+
release = '3.6.2'
6363

6464
# The language for content autogenerated by Sphinx. Refer to documentation
6565
# for a list of supported languages.

docs/getting-started.rst

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Twilio REST API.
88

99

1010
Make a Call
11-
===============
11+
===========
1212

1313
.. code-block:: python
1414
@@ -26,7 +26,7 @@ Make a Call
2626
2727
2828
Send an SMS
29-
================
29+
===========
3030

3131
.. code-block:: python
3232
@@ -40,9 +40,24 @@ Send an SMS
4040
from_="+15555555555",
4141
body="Hello there!")
4242
43+
Send an MMS
44+
===========
45+
46+
.. code-block:: python
47+
48+
message = client.messages.create(
49+
body="Hello Monkey!", # Message body, if any
50+
to="+12125551234",
51+
from_="+15105551234",
52+
media_url=[ # List of media URLs, if any
53+
"http://example.com/image1.jpg",
54+
"http://example.com/image2.jpg",
55+
],
56+
)
57+
4358
4459
Generating TwiML
45-
=================
60+
================
4661

4762
To control phone calls, your application needs to output `TwiML
4863
<http://www.twilio.com/docs/api/twiml/>`_. Use :class:`twilio.twiml.Response`

docs/index.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,21 +54,22 @@ library.
5454
REST API
5555
----------
5656

57-
Query the Twilio REST API to create phone calls, send SMS messages and more!
57+
Query the Twilio REST API to create phone calls, send messages and more!
5858

5959
.. toctree::
6060
:maxdepth: 1
6161

6262
usage/basics
63+
usage/messages
6364
usage/phone-calls
6465
usage/phone-numbers
65-
usage/messages
6666
usage/accounts
6767
usage/conferences
6868
usage/applications
6969
usage/notifications
7070
usage/recordings
7171
usage/transcriptions
72+
usage/usage
7273
usage/caller-ids
7374
usage/queues
7475
usage/sip

docs/usage/applications.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Applications
66

77
An application inside of Twilio is just a set of URLs and other configuration
88
data that tells Twilio how to behave when one of your Twilio numbers receives
9-
a call or SMS message.
9+
a call or message.
1010

1111
For more information, see the `Application REST Resource
1212
<http://www.twilio.com/docs/api/rest/applications>`_ documentation.

docs/usage/basics.rst

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,29 @@ directly to the the constructor.
3838
client = TwilioRestClient(ACCOUNT_SID, AUTH_TOKEN)
3939
4040
41+
Proxies
42+
-------
43+
44+
:class:`TwilioRestClient` supports HTTP and SOCKS4/5 proxies. You can change
45+
the proxy configuration at any time with the :class:`Connection` class:
46+
47+
.. code-block:: python
48+
49+
from twilio.rest.resources import Connection
50+
from twilio.rest.resources.connection import PROXY_TYPE_SOCKS5
51+
52+
Connection.set_proxy_info(
53+
'example.com',
54+
5000,
55+
proxy_type=PROXY_TYPE_SOCKS5,
56+
proxy_user='username',
57+
proxy_pass='password',
58+
)
59+
60+
The :class:`TwilioRestClient` will retrieve and use the current proxy
61+
information for each request.
62+
63+
4164
Listing Resources
4265
-------------------
4366

docs/usage/messages.rst

Lines changed: 39 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
.. module:: twilio.rest.resources.sms_messages
22

33
============
4-
SMS Messages
4+
Messages
55
============
66

77
For more information, see the
@@ -28,10 +28,6 @@ Send a text message in only a few lines of code.
2828
body="Hello Monkey!", # Message body, if any
2929
to="+12125551234",
3030
from_="+15105551234",
31-
media_url=[ # List of media URLs, if any
32-
"http://example.com/image1.jpg",
33-
"http://example.com/image2.jpg",
34-
],
3531
)
3632
print message.sid
3733
@@ -41,6 +37,44 @@ If you want to send a message from a `short code
4137
to your short code's number.
4238

4339

40+
Sending a Picture Message
41+
-------------------------
42+
43+
To send a picture, set :attr:`media_url` to the url of the picture you wish to send.
44+
45+
.. code-block:: python
46+
47+
from twilio.rest import TwilioRestClient
48+
49+
# To find these visit https://www.twilio.com/user/account
50+
ACCOUNT_SID = "ACXXXXXXXXXXXXXXXXX"
51+
AUTH_TOKEN = "YYYYYYYYYYYYYYYYYY"
52+
53+
client = TwilioRestClient(ACCOUNT_SID, AUTH_TOKEN)
54+
55+
message = client.messages.create(
56+
body="Hello Monkey!", # Message body, if any
57+
to="+12125551234",
58+
from_="+15105551234",
59+
media_url="http://example.com/image1.jpg"
60+
)
61+
62+
You can send multiple pictures in the same message by setting :attr:`media_url` to
63+
a list of urls.
64+
65+
.. code-block:: python
66+
67+
message = client.messages.create(
68+
body="Hello Monkey!", # Message body, if any
69+
to="+12125551234",
70+
from_="+15105551234",
71+
media_url=[ # List of media URLs, if any
72+
"http://example.com/image1.jpg",
73+
"http://example.com/image2.jpg",
74+
],
75+
)
76+
77+
4478
Retrieving Sent Messages
4579
-------------------------
4680

docs/usage/sip.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Creating a Sip Domain
1313

1414
The :class:`Domains` resource allows you to create a new domain. To
1515
create a new domain, you'll need to choose a unique domain that lives
16-
under sip.twilio.com. For example, doug.sip.twilio.com.
16+
under sip.twilio.com. For example, dunder-mifflin-scranton.sip.twilio.com.
1717

1818
.. code-block:: python
1919
@@ -25,9 +25,9 @@ under sip.twilio.com. For example, doug.sip.twilio.com.
2525
client = TwilioRestClient(account_sid, auth_token)
2626
2727
domain = client.sip.domains.create(
28-
friendly_name="Sam's Domain",
28+
friendly_name="The Office Domain",
2929
voice_url="http://example.com/voice",
30-
domain_name="sam.sip.twilio.com",
30+
domain_name="dunder-mifflin-scranton.sip.twilio.com",
3131
)
3232
print domain.sid
3333
@@ -36,7 +36,7 @@ Creating a new IpAccessControlList
3636

3737
To control access to your new domain, you'll need to explicitly grant access
3838
to individual ip addresses. To do this, you'll first need to create an
39-
:class:`IpAccessControlList` to hold the ip addresses you wish to allow.
39+
:class:`IpAccessControlList` to hold the ip addresses you wish to allow.
4040

4141
.. code-block:: python
4242
@@ -48,7 +48,7 @@ to individual ip addresses. To do this, you'll first need to create an
4848
client = TwilioRestClient(account_sid, auth_token)
4949
5050
ip_acl = client.sip.ip_access_control_lists.create(
51-
friendly_name="My IpAccessControlList",
51+
friendly_name="The Office IpAccessControlList",
5252
)
5353
print ip_acl.sid
5454
@@ -69,7 +69,7 @@ Now it's time to add an :class:`IpAddress` to your new :class:`IpAccessControlLi
6969
ip_address = client.sip.ip_addresses(
7070
"AL456", # IpAccessControlList sid
7171
).create(
72-
friendly_name="Sam's Computer",
72+
friendly_name="Dwight's Computer",
7373
ip_address="192.168.1.42",
7474
)
7575
print ip_address.sid

0 commit comments

Comments
 (0)
0