Skip to main content

Termii Python Library for Termii API

Project description

termiipython

Termii Python Library for Termii API

Installation

pip install termiipython

Usage

  • Send SMS
from termiipython.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 termiipython.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 termiipython.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 termiipython.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 termiipython.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-2.0.0.tar.gz (4.5 kB view hashes)

Uploaded Source

Built Distribution

termiipython-2.0.0-py3-none-any.whl (5.4 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page