Termii Python Client
What is Termii
Termii is an API that provide endpoint which can be used to send sms messages, it also perform other functions which will be discussed below. click here for more about Termii
Key Features
-
Messaging: Allows you to send message to any country in the world across sms and whatsapp channels
-
Tokens: Allows business to generate,send and verify one time password (OTP)
-
Insight: Retrieve real-time delivery report of messages sent to customers as well as the status of their contact.
Usage
Install the python package from pip by running
pip install termii-python-client
Before delving into the usage, you need the following:
-
A Termii account : This can be created here
-
Get your api key which will be used for further api calls
Implementing python termii functionalities
- Initillize the Termii class
import os
from termii.termii import Termii
# get your api-key
api_key = os.environ.get("TERMII_API_KEY")
sender_id = os.environ.get("TERMII_SENDER_ID")
termii = Termii(api_key, sender_id)
Available methods
import os
from typing import Union, Literal
from termii.termii import Termii
termii = Termii(os.environ.get("TERMII_API_KEY"), os.environ.get("TERMII_SENDER_ID"))
termii.add_contact(phonebook_id: str, phone_number: str, country_code: Optional[int] = None, email_address: Optional[str] = None, first_name: Optional[str] = None, last_name: Optional[str] = None, company: Optional[str] = None)
termii.add_contacts(phonebook_id: str, contact_file: str, file_type: str, country_code: str)
termii.create_phonebook(phonebook_name: str, description: Optional[str] = None)
termii.delete_contact(contact_id: str)
termii.delete_phonebook(phonebook_id: str)
termii.email_token(email_address: str, code: str, email_configuration_id: str)
termii.generate_token(pin_type: Literal["NUMERIC", "ALPHANUMERIC"], phone_number: str, pin_attempts: int, pin_time_to_live: int, pin_length: int)
termii.get_balance()
termii.get_contact(phonebook_id: str)
termii.get_phonebooks()
termii.get_senderId()
termii.history()
termii.request_senderId(sender_id: str, use_case: str, company: str)
termii.send_auto_message(to: str, sms: str)
termii.send_bulk_message(_from: Union[str, None], to: Union[str, list], sms: Optional[str], type: str, channel: Literal["whatsapp", "dnd", "generic"])
termii.send_message(_from: str, to: str | None, type: str, channel: Literal["whatsapp", "dnd", "generic"], sms: Union[str, None] = None, media: Union[Optional[Mapping[Literal["url", "caption"], str]], None] = None)
termii.send_token(message_type: Literal["NUMERIC", "ALPHANUMERIC"], to: str, _from: str, channel: Literal["generic", "dnd", "whatsapp"], message_text: str, pin_time_to_live: int = 60, pin_attempts: int = 3, pin_length: int = 4, pin_placeholder: str = "< 1234 >")
termii.update_phonebook(phonebook_id: str, phonebook_name: str, description: Optional[str] = None)
termii.verify_phone_number(phone_number: str)
termii.verify_token(pin_id: str, pin: str)
termii.voice_call(phone_number: str, code: str)
termii.voice_token(phone_number: str, pin_attempts: int, pin_time_to_live: int, pin_length: int)
To get more detail about a particular method, use the python help() function
Contributors
- Gabriel Michael Ojomakpene [codewitgabi]
- Joseph Joshua
Metadata
Release files for termii-python-client 1.3.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| termii_python_client-1.3.1.tar.gz | 10.7 kB | Without provenance | Details for termii_python_client-1.3.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| termii_python_client-1.3.1-py3-none-any.whl | Python 3 | none | any | Details for termii_python_client-1.3.1-py3-none-any.whl |
Total release size: 18.7 kB
Release files / termii_python_client-1.3.1.tar.gz
| Download URL | termii_python_client-1.3.1.tar.gz |
|---|---|
| Size | 10.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1b2030ca39f69e741b03d5f61e252fb86c8c48b13a1247dee7bfe58ecd1cf286
|
|
BLAKE2b-256 checksum How to use checksums |
c538a216964e6711d55a2719c7381dc9dd15b6bd5b2a00ab2cbeddbb3327cb70
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.12.2
|
Release files / termii_python_client-1.3.1-py3-none-any.whl
| Download URL | termii_python_client-1.3.1-py3-none-any.whl |
|---|---|
| Size | 8.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4821d5841b1bc2eae6aa8445e766d5c7ce1cff68b5573f793483a4c8791b5ddb
|
|
BLAKE2b-256 checksum How to use checksums |
c2119d7018af37c07606e3273eb0d46c231bf4aae9b566e65f9c419dfccecca7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.12.2
|
Security for termii-python-client 1.3.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.