@@ -61,7 +61,6 @@ to augment your search. The `AvailablePhoneNumbers REST Resource
61
61
<http://www.twilio.com/docs/api/rest/available-phone-numbers> `_ documentation
62
62
also documents the various search options.
63
63
64
-
65
64
Buying a Number
66
65
---------------
67
66
@@ -78,45 +77,53 @@ If you've found a phone number you want, you can purchase the number.
78
77
client = TwilioRestClient(ACCOUNT_SID , AUTH_TOKEN )
79
78
number = client.phone_numbers.purchase(" +15305431234" )
80
79
81
- However, it's easier to purchase numbers after finding them using search (as shown in the first example).
82
-
80
+ However, it's easier to purchase numbers after finding them using search (as
81
+ shown in the first example).
83
82
84
- Changing Applications
85
- ----------------------
83
+ Updating Properties on a Number
84
+ ------------------
86
85
87
- An :class: `Application ` encapsulates all necessary URLs for use with phone numbers. Update an application on a phone number using :meth: `update `.
86
+ To update the properties on a phone number, call :meth: `update `
87
+ on the phone number object, with any of the parameters
88
+ listed in the `IncomingPhoneNumbers Resource documentation
89
+ <http://www.twilio.com/docs/api/rest/incoming-phone-numbers> `_
10000
td>88
90
89
91
.. code-block :: python
90
92
91
93
from twilio.rest import TwilioRestClient
92
94
93
- phone_sid = " PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
94
-
95
95
# To find these visit https://www.twilio.com/user/account
96
96
ACCOUNT_SID = " ACXXXXXXXXXXXXXXXXX"
97
97
AUTH_TOKEN = " YYYYYYYYYYYYYYYYYY"
98
98
99
99
client = TwilioRestClient(ACCOUNT_SID , AUTH_TOKEN )
100
- number = client.phone_numbers.update(phone_sid, sms_application_sid = " AP123" )
100
+ for number in client.phone_numbers.list(api_version = " 2010-04-01" ):
101
+ number.update(voice_url = " http://twimlets.com/holdmusic?" +
102
+ " Bucket=com.twilio.music.ambient" ,
103
+ status_callback = " http://example.com/callback" )
101
104
102
- See :doc: `/usage/applications ` for instructions on updating and maintaining Applications.
105
+ Changing Applications
106
+ ----------------------
103
107
104
- Validate a Phone Number
105
- -----------------------
106
- Validating a phone number is quick and easy.
108
+ An :class: `Application ` encapsulates all necessary URLs for use with phone numbers. Update an application on a phone number using :meth: `update `.
107
109
108
110
.. code-block :: python
109
111
110
112
from twilio.rest import TwilioRestClient
111
113
114
+ phone_sid = " PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
115
+
112
116
# To find these visit https://www.twilio.com/user/account
113
117
ACCOUNT_SID = " ACXXXXXXXXXXXXXXXXX"
114
118
AUTH_TOKEN = " YYYYYYYYYYYYYYYYYY"
115
119
116
120
client = TwilioRestClient(ACCOUNT_SID , AUTH_TOKEN )
117
- response = client.caller_ids.validate(" +9876543212" )
118
- print response[" validation_code" ]
121
+ number = client.phone_numbers.update(phone_sid, sms_application_sid = " AP123" )
122
+
123
+ See :doc: `/usage/applications ` for instructions on updating and maintaining Applications.
124
+
125
+ Validate a Phone Number
126
+ -----------------------
119
127
120
- Twilio will call the provided number and wait for the validation code to be
121
- entered.
128
+ See validation instructions here: :doc: `/usage/caller-ids `:
122
129
0 commit comments