BulkSmsZW-Api
- bulksmszw api for sending affordable text messages in Python
- for Embedded device supported library in C++ for ESP8266-Arduino boards for IoT check out the ported library bulksms ESP8266
Installation
- make sure git is installed on your system or download repo as zip
- In cmd or terminal do
$ git clone https://github.com/DonnC/BulkSmsZW-Api.git
$ cd BulkSmsZW-Api
$ python setup.py install
- or directly with pip,
python3.x
$ pip install bulksmszw
Authentication details
- register an account on bulksms website
- if already have an account, login on bulksms web portal
- Got to "My Account", then Click on "User Configuration", to obtain "Webservices token".
Sending default message
- test file test_api.py
- recipients is passed as a list of bulksms valid format
2637xxxxxxxx, list can also contain groups#devteamand can be mixed
api = Client(<username>, <token>)
respond = api.send("hello guys", ['2637xxxxxxxx', '#devteam', '#students'])
- Example script
from BulkSmsApi.Client import Client
bulksms = Client(<username>, <web-token>)
response = bulksms.send(body="bulk sms ZW api testing", recipients=['2637xxxxxxxx', '2637yyyyyyyy'])
print(response)
- On successful run, the response
Send message and get credits(text messages) left
creditsflag by default is set toFalse- to receive the number of credits on your web portal, set the
creditflag toTrue
api = Client(<username>, <token>)
credits_response = api.send(body="hello world", recipients=['2637xxxxxxxx'], credits=True)
print(credits_response)
Catch BulkSmsZw status errors as python exceptions
- You can wrap your code in a
try - exceptto catch unsuccessful and bulksms error messages as normal python exceptions
# this wil throw an exception because of the wrong / not valid username
bulksms = Client(username=<wrong-username>, token=<web-token>)
try:
response = bulksms.send(body="bulk sms ZW api testing", recipients=['2637xxxxxxxx', '2637yyyyyyyy'])
print(response)
except Exception as exc:
print("Encountered an Error: %s" %exc)
Responses
- responses are in default JSON format used by BulkSMSZW service
acknowledgements
- Big shoutout to the BulkSMS ZW team
- Original bulksms python api script
- All credits to the Bulk SMS ZW Team
HTTP API
- api docs HTTP API INTEGRATION DOC
TODO
- Schedule messages
- Validate phone numbers
get in contact
Metadata
Release files for Bulksmsapi-zw 1.2.0
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 |
|---|---|---|---|---|
| Bulksmsapi-zw-1.2.0.tar.gz | 4.4 kB | Without provenance | Details for Bulksmsapi-zw-1.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| Bulksmsapi_zw-1.2.0-py3-none-any.whl | Python 3 | none | any | Details for Bulksmsapi_zw-1.2.0-py3-none-any.whl |
Total release size: 10.2 kB
Release files / Bulksmsapi-zw-1.2.0.tar.gz
| Download URL | Bulksmsapi-zw-1.2.0.tar.gz |
|---|---|
| Size | 4.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b99e0e2d7a0eafb8b52abd87cc726d6aa43e15865ae360a653e64aa96b32856c
|
|
BLAKE2b-256 checksum How to use checksums |
ad135493adc8b72b5b2812583bbf1a9b30c4c92ccd49e9531e11f6d23238206e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/2.0.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.3
|
Release files / Bulksmsapi_zw-1.2.0-py3-none-any.whl
| Download URL | Bulksmsapi_zw-1.2.0-py3-none-any.whl |
|---|---|
| Size | 5.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
02cc7c354ba3b912877534a32a4f3a7485c427784b7870312b260675928c2ecc
|
|
BLAKE2b-256 checksum How to use checksums |
6c996121ed6d9f029e408a7c6fda3b17ee78f5691127b5ed2c0434dff1c5553b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/2.0.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.3
|
Security for Bulksmsapi-zw 1.2.0
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.