Skip to main content

Termii python package

Project description

Termii Python Client Static Badge



GitHub commit activity GitHub language count GitHub Issues or Pull Requests GitHub Issues or Pull Requests GitHub License GitHub repo size GitHub Tag PyPI - Version

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

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

termii_python_client-1.3.0.tar.gz (10.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

termii_python_client-1.3.0-py3-none-any.whl (8.0 kB view details)

Uploaded Python 3

File details

Details for the file termii_python_client-1.3.0.tar.gz.

File metadata

  • Download URL: termii_python_client-1.3.0.tar.gz
  • Upload date:
  • Size: 10.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.2

File hashes

Hashes for termii_python_client-1.3.0.tar.gz
Algorithm Hash digest
SHA256 dcd98049e9011ace49f5f5754be075923e86fcaa735f7cc560adb55a7d0b4655
MD5 fd824685c99a9a89e4e3985223414e42
BLAKE2b-256 02eb4606f939233a87ef5aabd2465b7dd55e18be3f8779d0ee47fdde4e63610c

See more details on using hashes here.

File details

Details for the file termii_python_client-1.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for termii_python_client-1.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d6b0216145c846bb08a73e4277ce9f5c52b5caec79b2e6dd4a3f1f4d5c1644ad
MD5 f4cb1296619156164a74f263c3c9b9e0
BLAKE2b-256 049351a11c024d47a0d04dd4e92adc4385c1efc1fae963b7a98fbd8e93a8d0f8

See more details on using hashes here.

Supported by

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