Skip to main content

A small python Package for Zamtel bulk SMS API

Project description

Zamte SMS

Zamtel bulk SMS api example in Python

Installation

pip install zamtel-pysms

Setup

Create a .env file in the root of your project and add the following

API_KEY=YOUR_API_KEY_FROM_ZAMTEL
SENDER_ID=YOUR_SENDER_ID_FROM_ZAMTEL
BASE_URL=https://bulksms.zamtel.co.zm/api/v2.1/action/send/

  • API_KEY is the API_KEY you can from Zamtel
  • SENDER_ID is the SENDER_ID you can from Zamtel

Usage

You can use the function to send a single here is an example

from sms import send_sms

response = send_sms('0975442232', 'Hello there, I am testing the Zamtel Bulk SMS API')

print(response)

You can also pass an array of phone numbers to send a sms SMS to multiple clients.

from sms import send_sms

phone_numbers = ['0976xxxxxx','0976xxxxxx','0976xxxxxx','0976xxxxxx','0976xxxxxx',]

message = 'Hello there, I am testing the Zamtel Bulk SMS API'

response =  send_sms(phone_numbers, message)

print(response)

# output

{'success': True, 'responseText': 'SMS(es) have been queued for delivery'}

It is as simple as that 😃

Happy coding!!

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

zamtelsms-0.0.3.tar.gz (2.9 kB view details)

Uploaded Source

File details

Details for the file zamtelsms-0.0.3.tar.gz.

File metadata

  • Download URL: zamtelsms-0.0.3.tar.gz
  • Upload date:
  • Size: 2.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.13

File hashes

Hashes for zamtelsms-0.0.3.tar.gz
Algorithm Hash digest
SHA256 12537059b06a7488586e3d6c2d71ef185fd8d295de88b95f99459d00bc2f13a5
MD5 ef300de0b77ba8e45e09f268763f77ef
BLAKE2b-256 4a53853cdff4ac2d3bbc3aa3f37501069f1bd2f54b825101927dedc5ee2288d7

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