Connect to the Twizo API using the python 3 library. This API includes functions to send verifications (2FA), SMS and Number Lookup.
To use the Twizo API client, the following things are required:
- Create a Twizo account
- Login on the Twizo portal
- Find your application secret
- Find your nearest api node
pip -- Link needs to be added
$ pip install twizo-lib-python
Initialize the Twizo API with your api host and api key
from twizo import Twizo
twizo = Twizo(api_key="<Your api key here>",
api_host="<Your desired api host here>")
Create a new verification
params = VerificationParams('12345000000')
response = twizo.verification_controller.create(params)
Verify token
verify_result = twizo.verification_controller.verify_token(
response.messageId, "012345"
)
Send sms
params = SmsParams(
recipients='60123456789',
body="Hey Alice, how are you doing?",
sender='John')
response = twizo.sms_controller.send_simple(params)
In the examples directory you can find some examples of how to use the api.
The MIT License. Copyright (c) 2016-2017 Twizo
Contact: www.twizo.com — support@twizo.com