8000 doc fixes · Twilio-api/twilio-python@8a143d9 · GitHub
[go: up one dir, main page]

Skip to content

Commit 8a143d9

Browse files
author
Doug Black
committed
doc fixes
1 parent 58850d7 commit 8a143d9

File tree

4 files changed

+60
-11
lines changed

4 files changed

+60
-11
lines changed

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: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,15 +54,15 @@ 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

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/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

0 commit comments

Comments
 (0)
0