8000 Document Call/Message deletion · madCode/twilio-python@1d6bc83 · GitHub
[go: up one dir, main page]

Skip to content

Commit 1d6bc83

Browse files
committed
Document Call/Message deletion
1 parent b000528 commit 1d6bc83

File tree

2 files changed

+43
-0
lines changed

2 files changed

+43
-0
lines changed

docs/usage/messages.rst

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,3 +120,27 @@ The following will only show messages to "+5466758723" on January 1st, 2011.
120120
for message in messages:
121121
print message.body
122122
123+
Redacting or Deleting Message Records
124+
-------------------------------------
125+
126+
To protect your users' privacy and/or comply with legal requirements,
127+
Twilio allows you to redact your :class:`Message` bodies or delete the records
128+
outright.
129+
130+
.. code-block:: python
131+
132+
from twilio.rest import TwilioRestClient
133+
134+
# To find these visit https://www.twilio.com/user/account
135+
ACCOUNT_SID = "ACXXXXXXXXXXXXXXXXX"
136+
AUTH_TOKEN = "YYYYYYYYYYYYYYYYYY"
137+
138+
client = TwilioRestClient(ACCOUNT_SID, AUTH_TOKEN)
139+
message_sid = "MM123"
140+
141+
client.messages.redact(message_sid)
142+
message = client.messages.get(message_sid)
143+
print message.body # Will be an empty string
144+
145+
client.messages.delete(message_sid) # Deletes record entirely, subsequent requests will return 404
146+

docs/usage/phone-calls.rst

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,25 @@ you can use the client to retrieve that record.
5050
call = client.calls.get(sid)
5151
5252
53+
54+
Delete a Call Record
55+
--------------------
56+
57+
You can delete your :class:`Call` resources from Twilio's storage
58+
to protect your users' privacy and/or comply with legal requirements.
59+
60+
.. code-block:: python
61+
62+
from twilio.rest import TwilioRestClient
63+
64+
# To find these visit https://www.twilio.com/user/account
65+
ACCOUNT_SID = "ACXXXXXXXXXXXXXXXXX"
66+
AUTH_TOKEN = "YYYYYYYYYYYYYYYYYY"
67+
68+
client = TwilioRestClient(ACCOUNT_SID, AUTH_TOKEN)
69+
sid = "CA12341234"
70+
client.calls.delete(sid)
71+
5372
Accessing Specific Call Resources
5473
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
5574

0 commit comments

Comments
 (0)
0