10000 document some popular methods · jseims/twilio-python@f812782 · GitHub
[go: up one dir, main page]

Skip to content

Commit f812782

Browse files
committed
document some popular methods
1 parent 6f3adc9 commit f812782

File tree

3 files changed

+35
-15
lines changed

3 files changed

+35
-15
lines changed

docs/api/twiml.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Primary Verbs
2626
:members:
2727

2828
Secondary Verbs
29-
~~~~~~~~~~~~~~
29+
~~~~~~~~~~~~~~~
3030

3131
.. autoclass:: twilio.twiml.Hangup
3232
:members:

docs/usage/conferences.rst

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,6 @@ access the participants resource.
7373
Participants can be either muted or kicked out of the conference. The following
7474
code kicks out the first participants and mutes the rest.
7575

76-
.. note::
77-
7876
.. code-block:: python
7977
8078
from twilio.rest import TwilioRestClient

twilio/rest/resources.py

Lines changed: 34 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -652,7 +652,29 @@ def create(self, to, from_, url, method=None, fallback_url=None,
652652
if_machine=None, send_digits=None, timeout=None,
653653
application_sid=None):
654654
"""
655-
Make a phone call to a number
655+
Make a phone call to a number.
656+
657+
:param string to: The phone number to call
658+
:param string `from_`: The caller ID (must be a verified Twilio number)
659+
:param string url: The URL to read TwiML from when the call connects
660+
:param method: The HTTP method Twilio should use to request the url
661+
:type method: None (defaults to 'POST'), 'GET', or 'POST'
662+
:param string fallback_url: A URL that Twilio will request if an error occurs requesting or executing the TwiML at url.
663+
:param string fallback_method: The HTTP method that Twilio should use to request the fallback_url
664+
:type fallback_method: None (will make a 'POST' request), 'GET', or 'POST'
665+
:param string status_callback: A URL that Twilio will request when the call ends to notify your app.
666+
:param string status_method: The HTTP method Twilio should use when requesting the above URL.
667+
:param string if_machine: Tell Twilio to try and determine if a machine
668+
(like voicemail) or a human has answered the call.
669+
See more in our `answering machine documentation
670+
<http://www.twilio.com/docs/api/rest/making_calls#handling-outcomes-answering-machines">`_.
671+
:type if_machine: None, 'Continue', or 'Hangup'
672+
:param string send_digits: A string of keys to dial after connecting to the number.
673+
:type send_digits: None or any combination of (0-9), '#', '*' or 'w' (to insert a half second pause).
674+
:param int timeout: The integer number of seconds that Twilio should allow the phone to ring before assuming there is no answer.
675+
:param string application_sid: The 34 character sid of the application Twilio should use to handle this phone call. Should not be used in conjunction with the url parameter.
676+
677+
:return: An :class:`Call` object
656678
"""
657679
params = transform_params({
658680
"To": to,
@@ -679,7 +701,7 @@ def update(self, sid, status=None, method=None, url=None):
679701
return self.update_instance(sid, params)
680702

681703
def cancel(self, sid):
682-
""" If this call is queued or ringing, cancel the call
704+
""" If this call is queued or ringing, cancel the call.
683705
Will not affect in-progress calls.
684706
685707
:param sid: A Call Sid for a specific call
@@ -817,7 +839,7 @@ def transfer(self, account_sid):
817839

818840
def update(self, **kwargs):
819841
"""
820-
Update this phone number instance.
842+
Update this phone number instance.
821843
"""
822844
a = self.parent.update(self.name, **kwargs)
823845
self.load(a.__dict__)
@@ -1024,10 +1046,11 @@ def create(self, to=None, from_=None, body=None, status_callback=None,
10241046
"""
10251047
Create and send a SMS Message.
10261048
1027-
:param to: The destination phone number.
1028-
:param from_: The phone number sending this message.
1029-
:param body: The message you want to send, limited to 160 characters.
1030-
:param status_callback: URL that Twilio will update with message info
1049+
:param string to: The destination phone number.
1050+
:param string `from_`: The phone number sending this message (must be a verified Twilio number)
1051+
:param string body: The message you want to send, limited to 160 characters.
1052+
:param status_callback: A URL that Twilio will POST to when your message is processed.
1053+
:param string application_sid: The 34 character sid of the application Twilio should use to handle this phone call.
10311054
"""
10321055
params = transform_params({
10331056
"To": to,
@@ -1045,7 +1068,7 @@ def list(self, to=None, from_=None, before=None, after=None, **kwargs):
10451068
paging informtion see :class:`ListResource`.
10461069
10471070
:param to: Only show SMS messages to this phone number.
1048-
:param from_: Only show SMS messages from this phone number.
1071+
:param `from_`: Only show SMS messages from this phone number.
10491072
:param date after: Only list recordings logged after this datetime
10501073
:param date before: Only list recordings logged before this datetime
10511074
"""
@@ -1073,7 +1096,7 @@ class ShortCodes(ListResource):
10731096
def list(self, short_code=None, friendly_name=None, **kwargs):
10741097
"""
10751098
Returns a page of :class:`ShortCode` resources as a list. For
1076-
paging informtion see :class:`ListResource`.
1099+
paging information see :class:`ListResource`.
10771100
10781101
:param short_code: Only show the ShortCode resources that match this
10791102
pattern. You can specify partial numbers and use '*'
@@ -1090,8 +1113,7 @@ def list(self, short_code=None, friendly_name=None, **kwargs):
10901113
def update(self, sid, friendly_name=None, api_version=None, url=None,
10911114
method=None, fallback_url=None, fallback_method=None):
10921115
"""
1093-
Returns a page of :class:`SMSMessage` resources as a list. For
1094-
paging informtion see :class:`ListResource`.
1116+
Update a specific :class:`ShortCode`, by specifying the sid.
10951117
10961118
:param friendly_name: Description of the short code, with maximum
10971119
length 64 characters.
@@ -1271,7 +1293,7 @@ def create(self, friendly_name=None, api_version=None, voice_url=None,
12711293
sms_url=None, sms_method=None, sms_fallback_url=None,
12721294
sms_fallback_method=None, sms_status_callback=None):
12731295
"""
1274-
Update an :class:`Application` with any of these optional parameters.
1296+
Create an :class:`Application` with any of these optional parameters.
12751297
12761298
:param friendly_name: A human readable description of the application,
12771299
with maximum length 64 characters.

0 commit comments

Comments
 (0)
0