You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/usage/token-generation.rst
+18-6Lines changed: 18 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -4,16 +4,26 @@
4
4
Generate Capability Tokens
5
5
===========================
6
6
7
-
`Twilio Client <http://www.twilio.com/api/client>`_ allows you to make and recieve connections in the browser. You can place a call to a phone on the PSTN network, all without leaving your browser. See the `Twilio Client Quickstart <http:/www.twilio.com/docs/quickstart/client>`_ to get up and running with Twilio Client.
7
+
`Twilio Client <http://www.twilio.com/api/client>`_ allows you to make and
8
+
recieve connections in the browser. You can place a call to a phone on the PSTN
9
+
network, all without leaving your browser. See the `Twilio Client Quickstart
10
+
<http:/www.twilio.com/docs/quickstart/client>`_ to get up and running with
11
+
Twilio Client.
8
12
9
-
Capability tokens are used by `Twilio Client <http://www.twilio.com/api/client>`_ to provide connection security and authorization. The `Capability Token documentation <http://www.twilio.con/docs/tokens>`_ explains indepth the purpose and features of these tokens.
13
+
Capability tokens are used by `Twilio Client
14
+
<http://www.twilio.com/api/client>`_ to provide connection
15
+
security and authorization. The `Capability Token documentation
16
+
<http://www.twilio.con/docs/tokens>`_ explains indepth the purpose and features
17
+
of these tokens.
10
18
11
-
:class:`TwilioCapability` is responsible for the creation of these capability tokens. You'll need your Twilio AccountSid and AuthToken.
19
+
:class:`TwilioCapability` is responsible for the creation of these capability
20
+
tokens. You'll need your Twilio AccountSid and AuthToken.
12
21
13
22
.. code-block:: python
14
23
15
24
from twilio.util import TwilioCapability
16
25
26
+
# Find these values at twilio.com/user/account
17
27
account_sid ="AC123123"
18
28
auth_token ="secret"
19
29
@@ -37,7 +47,7 @@ To make an outgoing connection from a `Twilio Client <http://www.twilio.com/api/
By default, this token will expire in one hour. If you'd like to change the token expiration, :meth:`generate` takes an optional :attr:`expires` argument.
60
+
By default, this token will expire in one hour. If you'd like to change the
61
+
token expiration, :meth:`generate` takes an optional :attr:`expires` argument.
51
62
52
63
.. code-block:: python
53
64
54
65
token = capability.generate(expires=600)
55
66
56
-
This token will now expire in 10 minutes. If you haven't guessed already, :attr:`expires` is expressed in seconds.
67
+
This token will now expire in 10 minutes. If you haven't guessed already,
0 commit comments