Termii Python Library for Termii API
Project description
termiipython
Termii Python Library for Termii API
Installation
pip install termiipython
Usage
- Send SMS
from termii.Termii import Termii
# Initialize a Termii instance with your sender ID and API key
termii = Termii(sender_id='TERMII_SENDER_ID', api_key='TERMII_API_KEY')
# Define the payload for sending an SMS
sms_payload = {
'phone_number': 'RecipientPhoneNumber',
'message': 'Hello, this is a test message from termiipython!'
}
# Send the SMS
response = termii.send_message(sms_payload)
# Check the response
print(response)
- Send Token
from termii.Termii import Termii
# Initialize a Termii instance with your sender ID and API key
termii = Termii(sender_id='TERMII_SENDER_ID', api_key='TERMII_API_KEY')
# Define the payload for sending an SMS
sms_payload = {
'phone_number': 'RecipientPhoneNumber',
'message': 'Hello, this is a test message from termiipython!'
}
# Send the SMS
response = termii.send_message(sms_payload)
# Check the response
print(response)
- Verify Token
from termii.Termii import Termii
# Initialize a Termii instance with your sender ID and API key
termii = Termii(sender_id='TERMII_SENDER_ID', api_key='TERMII_API_KEY')
verify_payload = {
'pin_id': 'PinIdFromPreviousResponse',
'pin': '123456' # Replace with the actual PIN entered by the user
}
# Verify the token
response = termii.verify_token(verify_payload)
# Check the verification response
print(response)
- InApp Token
from termii.Termii import Termii
# Initialize a Termii instance with your sender ID and API key
termii = Termii(sender_id='TERMII_SENDER_ID', api_key='TERMII_API_KEY')
# Define the payload for generating an in-app token
in_app_token_payload = {
'phone_number': 'RecipientPhoneNumber',
}
# Generate the in-app token
response = termii.in_app_token(in_app_token_payload)
# Check the in-app token response
print(response)
- Available Methods
from termii.Termii import Termii
# Initialize a Termii instance with your sender ID and API key
termii = Termii(sender_id='TERMII_SENDER_ID', api_key='TERMII_API_KEY')
termii.send_message()
termii.send_token()
termii.verify_token()
termii.in_app_token()
termii.send_with_auto_generated_number()
termii.get_sender_ids()
termii.get_response()
termii.set_max_attempts()
termii.set_pin_time_to_live()
termii.set_pin_type()
termii.set_channel()
termii.set_pin_placeholder()
termii.set_message_type()
termii.set_token_message_type()
termii.set_pin_length()
termii.set_sender()
termii.set_api_key()
termii.get_sender_ids()
termii.get_balance()
termii.search()
Contributing
Interested in contributing? Check out the contributing guidelines. Please note that this project is released with a Code of Conduct. By contributing to this project, you agree to abide by its terms.
License
termiipython
was created by Solomon Olatunji. It is licensed under the terms of the MIT license.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
termiipython-1.0.0.tar.gz
(4.4 kB
view hashes)
Built Distribution
Close
Hashes for termiipython-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | db29e6cbf5cdc67d9ebaaac7bfe7d0ce594bc97246021fff68571a4620706a67 |
|
MD5 | 35ed8d83855543a30fca82d4a657201d |
|
BLAKE2b-256 | b3cb889c1dfbb613e795fd04e095465ead9e4d959bb253280ab16f8fc979d5db |