TeleSign Python SDK Documentation¶
Overview¶
TeleSign Web Services conform to the REST Web Service Design Model. Services are exposed as URI-addressable resources through the set of RESTful procedures in our TeleSign REST API.
The TeleSign Python SDK is a set of software development tools; a Python Library that wraps the TeleSign REST API, and it simplifies TeleSign application development in the Python programming language. The SDK software is listed in the Python Package Index (PyPI), as the telesign Python package.
- telesign
- Instructions on how to get the package.
- telesign.api
- The complete API documentation, organized by module.
- telesign.exceptions
- Exception classes for error handling.
Getting Help¶
If you’re having trouble, or have questions about TeleSign, please contact our customer support team:
Email: support@telesign.com
About This Documentation¶
This documentation contains information on how to download and install the TeleSign Python SDK, and it contains a comprehensive set of Python language reference pages that detail the TeleSign Python classes and methods that wrap the TeleSign REST API.
This documentation was generated using the Sphinx documentation generator. The source files for the documentation are located in the doc/ directory of the telesign distribution. You can regenerate the docs locally by running the following command from the root directory of the telesign source:
$ python setup.py doc
Documentation Map¶
telesign
¶
The telesign Python Package contains the TeleSign Python SDK software, and it is registered with the Python Package Index (PyPI).
Installing the SDK
¶
There are three approaches you can use to install the SDK:
Using pip¶
On platforms other than Windows, we recommend using pip to install telesign, using the following command:
$ pip install telesign
To install a specific version of telesign, simply add the version number to the command line, as in the following example:
$ pip install telesign==1.0.0To upgrade an existing telesign installation, use the –upgrade switch, as in the following example:
$ pip install --upgrade telesign
Using easy_install¶
On Windows-based Python deployments, you can use Easy Install to install telesign, using the following command:
$ easy_install telesign
To upgrade an existing telesign installation, use the -U switch, as in the following example:
$ easy_install -U telesign
Using our source¶
If you would like to try-out the latest bits, you can clone a local version of our public source code repository on GitHub, and then install from your enlistment, as in the following example:
$ git clone git://github.com/TeleSign/python_telesign.git telesign $ cd telesign/ $ python setup.py install
telesign.api
¶
The telesign.api module contains Python classes and methods that allow you to use the Python programming language to programmatically access the Verify and the PhoneId TeleSign web services.
Verify |
The Verify class exposes several services for sending users a verification token. |
PhoneId |
The PhoneId class exposes three services that each provide detailed information about a specified phone number. |
telesign.api.Verify
¶
call |
Calls the specified phone number, and using speech synthesis, speaks the verification code to the user. |
sms |
Sends a text message containing the verification code, to the specified phone number (supported for mobile phones only). |
status |
Retrieves the verification result. |
telesign.api.PhoneId
¶
standard |
Retrieves the standard set of details about the specified phone number. |
score |
Retrieves a score for the specified phone number. |
contact |
In addition to the information retrieved by standard, this service provides the Name & Address associated with the specified phone number. |
live |
In addition to the information retrieved by standard, this service provides actionable data associated with the specified phone number. |
telesign.exceptions
¶
You need the telesign.exceptions module to handle the exception conditions raised by the functions in the telesign.api module.
TelesignError |
The exceptions base class. |
AuthorizationError |
Either the client failed to authenticate with the REST API server, or the service cannot be executed using the specified credentials. |
ValidationError |
The submitted data failed the intial validation, and the service was not executed. |
telesign.api
¶
The api module contains Python classes and methods that allow you to use the Python programming language to programmatically access the Verify and PhoneId TeleSign web services.
Classes
Verify |
The Verify class exposes several services for sending users a verification token. |
PhoneId |
The PhoneId class exposes three services that each provide detailed information about a specified phone number. |
telesign.exceptions
¶
The exceptions module contains exception classes for handling the error conditions that can be thrown by procedures in the api module.
Exceptions
TelesignError |
The exceptions base class. |
AuthorizationError |
Either the client failed to authenticate with the REST API server, or the service cannot be executed using the specified credentials. |
ValidationError |
The submitted data failed the intial validation, and the service was not executed. |