Skip to content

Commit 3c54e17

Browse files
author
Jarrad Lee
committed
Refactored README based on public SDK. secret_key is now known as api_key. Added example customer_id and api_key to all examples.
1 parent e42f5b3 commit 3c54e17

15 files changed

+69
-81
lines changed

README.rst

Lines changed: 32 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,19 @@
1-
========
2-
TeleSign
3-
========
1+
==============================
2+
TeleSign Enterprise Python SDK
3+
==============================
44

5-
TeleSign provides the world’s most comprehensive approach to account security for Web and mobile applications.
5+
TeleSign is a communications platform as a service (CPaaS) company, founded on security. Since 2005, TeleSign has
6+
been a trusted partner to the world’s leading websites and mobile applications, helping secure billions of end-user
7+
accounts. Today, TeleSign’s data-driven, cloud communications platform is changing the way businesses engage with
8+
customers and prevent fraud.
69

7-
For more information about TeleSign, visit the `TeleSign website <http://www.TeleSign.com>`_.
8-
9-
TeleSign REST API: Python SDK
10-
-----------------------------
11-
12-
**TeleSign web services** conform to the `REST Web Service Design Model
13-
<http://en.wikipedia.org/wiki/Representational_state_transfer>`_. Services are exposed as URI-addressable resources
14-
through the set of *RESTful* procedures in our **TeleSign REST API**.
15-
16-
The **TeleSign Python SDK** is a set modules and functions — a *Python Library* that wraps the
17-
TeleSign REST API, and it simplifies TeleSign application development in the `Python programming language
18-
<http://pypi.python.org/pypi/>`_. The SDK software is distributed on
19-
`GitHub <https://github.com/TeleSign/python_telesign>`_ and also as a Python Software Package using the
20-
`Python Package Index (PyPI) <http://pypi.python.org/pypi/>`_.
10+
For more information about TeleSign, visit our `website <http://www.TeleSign.com>`_.
2111

2212
Documentation
2313
-------------
2414

25-
Detailed documentation for TeleSign REST APIs is available in the `Developer Portal <https://developer.telesign.com/>`_.
15+
Code documentation is included in the SDK. Complete documentation, quick start guides and reference material
16+
for the TeleSign API is available within the `TeleSign Developer Center <https://developer.telesign.com/>`_.
2617

2718
Installation
2819
------------
@@ -33,27 +24,40 @@ To install the TeleSign Enterprise Python SDK:
3324
3425
$ pip install -e ~/path/to/python_telesign_enterprise
3526
36-
Alternatively, you can execute **cd ~/path/to/python_telesign_enterprise && python setup.py install**.
27+
Authentication
28+
--------------
29+
30+
You will need a Customer ID and API Key in order to use TeleSign’s REST API. If you are already a customer and need an
31+
API Key, you can retrieve it from `TelePortal <https://teleportal.telesign.com>`_.
32+
33+
Dependencies
34+
------------
35+
36+
We make use of popular, feature-rich and well-tested open-source libraries to perform the underlying functionality of
37+
the SDK. These dependencies are managed by the community accepted package manager. If you are unable to add these
38+
additional third party dependencies to your project we have ensured that the SDK code is easy to read and can serve as
39+
sample code. We have also made sure that more complicated functions such as generate_telesign_headers can be easily
40+
extracted from the SDK and used 'as is' in your project.
3741

3842
Python Code Example: Verify SMS
3943
-------------------------------
4044

41-
Here's a basic code example with JSON response.
45+
Here is a basic code example with JSON response.
4246

4347
.. code-block:: python
4448
4549
from __future__ import print_function
4650
from telesignenterprise.verify import VerifyClient
4751
48-
customer_id = "customer_id"
49-
secret_key = "secret_key"
52+
customer_id = "FFFFFFFF-EEEE-DDDD-1234-AB1234567890"
53+
api_key = "EXAMPLE----TE8sTgg45yusumoN6BYsBVkh+yRJ5czgsnCehZaOYldPJdmFh6NeX8kunZ2zU1YWaUw/0wV6xfw=="
5054
5155
phone_number = "phone_number"
5256
53-
verify_client = VerifyClient(customer_id, secret_key)
54-
result = verify_client.sms(phone_number)
57+
verify_client = VerifyClient(customer_id, api_key)
58+
response = verify_client.sms(phone_number)
5559
56-
print(result.json)
60+
print(response.json)
5761
5862
.. code-block:: javascript
5963
@@ -66,16 +70,5 @@ Here's a basic code example with JSON response.
6670
'sub_resource': 'sms',
6771
'verify': {'code_entered': '', 'code_state': 'UNKNOWN'}}
6872
69-
For more examples, see the examples folder or visit `TeleSign Developer Portal <https://developer.telesign.com/>`_.
70-
71-
Authentication
72-
--------------
73-
74-
You will need a Customer ID and API Key in order to use TeleSign’s REST API. If you are already a customer and need an
75-
API Key, you can generate one in `TelePortal <https://teleportal.telesign.com>`_.
76-
77-
Testing
78-
-------
79-
80-
The easiest way to run the tests is to install `nose <https://pypi.python.org/pypi/nose>`_ (**pip install nose**) and
81-
run **nosetests** in the root of the distribution. Tests are located in the *test/* directory.
73+
For more examples, see the `examples <https://github.com/TeleSign/python_telesign_enterprise/tree/master/examples>`_ folder or
74+
visit the `TeleSign Developer Center <https://developer.telesign.com/>`_.

RELEASE

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
2.1.0
2+
- updated and improved README
3+
- secret_key refactored to api_key to align with docs and portal
4+
- api_host is now known as rest_endpoint to align with docs and portal
5+
- various doc string updates and fixes
6+
17
2.0.0
28

39
- Major refactor and simplification into generic REST client.

examples/phoneid_number_deactivation/1_check_phone_number_deactivated.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
from __future__ import print_function
22
from telesignenterprise.phoneid import PhoneIdClient
33

4-
customer_id = "customer_id"
5-
secret_key = "secret_key"
4+
customer_id = "FFFFFFFF-EEEE-DDDD-1234-AB1234567890"
5+
api_key = "EXAMPLE----TE8sTgg45yusumoN6BYsBVkh+yRJ5czgsnCehZaOYldPJdmFh6NeX8kunZ2zU1YWaUw/0wV6xfw=="
66

77
phone_number = "phone_number"
88
ucid = "ATCK"
99

10-
phoneid = PhoneIdClient(customer_id, secret_key)
10+
phoneid = PhoneIdClient(customer_id, api_key)
1111
response = phoneid.number_deactivation(phone_number, ucid)
1212

1313
if response.ok:

examples/phoneid_score/1_check_phone_number_risk_level.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
from __future__ import print_function
22
from telesignenterprise.phoneid import PhoneIdClient
33

4-
customer_id = "customer_id"
5-
secret_key = "secret_key"
4+
customer_id = "FFFFFFFF-EEEE-DDDD-1234-AB1234567890"
5+
api_key = "EXAMPLE----TE8sTgg45yusumoN6BYsBVkh+yRJ5czgsnCehZaOYldPJdmFh6NeX8kunZ2zU1YWaUw/0wV6xfw=="
66

77
phone_number = "phone_number"
88
ucid = "BACF"
99

10-
phoneid = PhoneIdClient(customer_id, secret_key)
10+
phoneid = PhoneIdClient(customer_id, api_key)
1111
response = phoneid.score(phone_number, ucid)
1212

1313
if response.ok:

examples/verify_sms/1_send_sms_with_verification_code.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
from telesignenterprise.verify import VerifyClient
33
from telesign.util import random_with_n_digits
44

5-
customer_id = "customer_id"
6-
secret_key = "secret_key"
5+
customer_id = "FFFFFFFF-EEEE-DDDD-1234-AB1234567890"
6+
api_key = "EXAMPLE----TE8sTgg45yusumoN6BYsBVkh+yRJ5czgsnCehZaOYldPJdmFh6NeX8kunZ2zU1YWaUw/0wV6xfw=="
77

88
phone_number = "phone_number"
99
verify_code = random_with_n_digits(5)
1010

11-
verify = VerifyClient(customer_id, secret_key)
11+
verify = VerifyClient(customer_id, api_key)
1212
response = verify.sms(phone_number, verify_code=verify_code)
1313

1414
user_entered_verify_code = raw_input("Please enter the verification code you were sent: ")
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
from __future__ import print_function
22
from telesignenterprise.verify import VerifyClient
33

4-
customer_id = "customer_id"
5-
secret_key = "secret_key"
4+
customer_id = "FFFFFFFF-EEEE-DDDD-1234-AB1234567890"
5+
api_key = "EXAMPLE----TE8sTgg45yusumoN6BYsBVkh+yRJ5czgsnCehZaOYldPJdmFh6NeX8kunZ2zU1YWaUw/0wV6xfw=="
66

77
phone_number = "phone_number"
88
template = "Your Widgets 'n' More verification code is $$CODE$$."
99

10-
verify = VerifyClient(customer_id, secret_key)
10+
verify = VerifyClient(customer_id, api_key)
1111
response = verify.sms(phone_number, template=template)

examples/verify_sms/3_send_custom_sms_in_different_language.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
from __future__ import print_function
33
from telesignenterprise.verify import VerifyClient
44

5-
customer_id = "customer_id"
6-
secret_key = "secret_key"
5+
customer_id = "FFFFFFFF-EEEE-DDDD-1234-AB1234567890"
6+
api_key = "EXAMPLE----TE8sTgg45yusumoN6BYsBVkh+yRJ5czgsnCehZaOYldPJdmFh6NeX8kunZ2zU1YWaUw/0wV6xfw=="
77

88
phone_number = "phone_number"
99
template = u"Votre code de vérification Widgets 'n' More est $$CODE$$."
1010

11-
verify = VerifyClient(customer_id, secret_key)
11+
verify = VerifyClient(customer_id, api_key)
1212
response = verify.sms(phone_number, template=template)

examples/verify_sms/4_send_custom_sms_with_custom_sender_id.py

Lines changed: 0 additions & 11 deletions
This file was deleted.

examples/verify_voice/1_send_voice_call_with_verification_code.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
from telesignenterprise.verify import VerifyClient
33
from telesign.util import random_with_n_digits
44

5-
customer_id = "customer_id"
6-
secret_key = "secret_key"
5+
customer_id = "FFFFFFFF-EEEE-DDDD-1234-AB1234567890"
6+
api_key = "EXAMPLE----TE8sTgg45yusumoN6BYsBVkh+yRJ5czgsnCehZaOYldPJdmFh6NeX8kunZ2zU1YWaUw/0wV6xfw=="
77

88
phone_number = "phone_number"
99
verify_code = random_with_n_digits(5)
1010

11-
verify = VerifyClient(customer_id, secret_key)
11+
verify = VerifyClient(customer_id, api_key)
1212
response = verify.voice(phone_number, verify_code=verify_code)
1313

1414
user_entered_verify_code = raw_input("Please enter the verification code you were sent: ")

examples/verify_voice/2_send_custom_voice_call_with_text_to_speech.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22
from telesignenterprise.verify import VerifyClient
33
from telesign.util import random_with_n_digits
44

5-
customer_id = "customer_id"
6-
secret_key = "secret_key"
5+
customer_id = "FFFFFFFF-EEEE-DDDD-1234-AB1234567890"
6+
api_key = "EXAMPLE----TE8sTgg45yusumoN6BYsBVkh+yRJ5czgsnCehZaOYldPJdmFh6NeX8kunZ2zU1YWaUw/0wV6xfw=="
77

88
phone_number = "phone_number"
99
verify_code = random_with_n_digits(5)
1010
tts_message = "Hello, your code is {verify_code}. Once again, your code is {verify_code}. Goodbye.".format(
1111
verify_code=", ".join(list(verify_code)))
1212

13-
verify = VerifyClient(customer_id, secret_key)
13+
verify = VerifyClient(customer_id, api_key)
1414
response = verify.voice(phone_number, tts_message=tts_message)
1515

1616
user_entered_verify_code = raw_input("Please enter the verification code you were sent: ")

0 commit comments

Comments
 (0)