The BulkSMSNigeria API Wrapper is a Python library that provides a convenient interface for sending SMS messages
Project description
BulkSMSNigeria API Wrapper Documentation
The BulkSMSNigeria API Wrapper is a Python library that provides a convenient interface for sending SMS messages using the BulkSMSNigeria SMS gateway. This library simplifies the process of sending messages to single or multiple recipients, retrieving account balance, and obtaining delivery reports.
Installation To use the BulkSMSNigeria API Wrapper, you need to
-
Create an account on BulkSMSNigeria.com (www.bulksmsnigeria.com/register)
-
Verify at least one of your contacts (i.e., email or phone number).
-
Fund your account with at least 500NGN.
-
Generate an API Token on the API Settings Page (www.bulksmsnigeria.com/app/api-settings)
-
Maintain a minimum balance of 100NGN in the account.
-
Have Python installed. You can install the library using pip:
pip install bulksmsnigeria
Getting Started
To begin using the BulkSMSNigeria API Wrapper, you need to import the necessary module and initialize an instance of the BulkSMSNigeria class:
from bulksmsnigeria import BulkSMSNigeria
# Initialize the BulkSMSNigeria object with your API token
api_token = 'YOUR_API_TOKEN'
bulksms = BulkSMSNigeria(api_token)
Replace YOUR_API_TOKEN with your actual API token obtained from BulkSMSNigeria
Sending SMS
Sending SMS to a Single Recipient
You can use the sendToOne method to send an SMS to a single recipient:
sender = 'SENDER_NAME'
recipient = 'RECIPIENT_PHONE_NUMBER'
body = 'MESSAGE_CONTENT'
response = bulksms.sendToOne(sender, recipient, body)
sender
(str): The name that will be displayed as the sender of the message.
recipient
(str): The phone number of the recipient.
body
(str): The content of the message.
The method returns a dictionary with the following keys:
status
(int): The HTTP status code of the request.
response
(dict): The JSON response received from the BulkSMSNigeria API.
Sending SMS to Multiple Recipients
You can use the sendToMany method to send an SMS to multiple recipients:
sender = 'SENDER_NAME'
recipients = ['RECIPIENT_PHONE_NUMBER_1', 'RECIPIENT_PHONE_NUMBER_2', ...]
body = 'MESSAGE_CONTENT'
response = bulksms.sendToMany(sender, recipients, body)
sender
(str): The name or phone number that will be displayed as the sender of the message.
recipients
(list): A list of phone numbers of the recipients.
body
(str): The content of the message.
The method returns a dictionary with the following keys:
status
(int): The HTTP status code of the request.
response
(dict): The JSON response received from the BulkSMSNigeria API.
Retrieving Account Balance
To retrieve your account balance, you can use the getWalletBalance method:
response = bulksms.getWalletBalance()
The method returns a dictionary with the following keys:
status
(int): The HTTP status code of the request.
response
(dict): The JSON response received from the BulkSMSNigeria API.
Retrieving Delivery Report
You can retrieve the delivery report of a sent message using the getDeliveryReport method:
message_id = 'MESSAGE_ID'
response = bulksms.getDeliveryReport(message_id)
message_id
(str): The unique ID of the message for which you want to obtain the delivery report.
The method returns a dictionary with the following keys:
status
(int): The HTTP status code of the request.
response
(dict): The JSON response received from the BulkSMSNigeria API.
Contributing
We welcome contributions from the community! If you would like to contribute to the BulkSMSNigeria Python library, please follow these guidelines:
- Fork the repository and create your branch from the
main
branch. - Make your changes and ensure that the code passes all tests.
- Write clear and concise commit messages.
- Submit a pull request to the
main
branch.
Code Style
Please adhere to the following code style guidelines:
- Use PEP 8 style guide for Python code.
- Write clear and meaningful variable and function names.
- Include comments to explain complex logic or important details.
- Follow the existing code formatting and structure.
Bug Reports and Feature Requests
If you encounter any bugs or have suggestions for new features, please open an issue on the GitHub repository. Provide a clear description of the problem or feature request and any relevant details.
Contact
If you have any questions or need assistance, you can reach out to us.
We appreciate your contributions and thank you for helping improve the BulkSMSNigeria Python library!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file bulksmsng-1.0.0.tar.gz
.
File metadata
- Download URL: bulksmsng-1.0.0.tar.gz
- Upload date:
- Size: 4.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2d57adb15000951bab27efc85a36adfde94adc99fe215dae872fa589e5a50352 |
|
MD5 | 8211a515ec40b0c6dad46c458ca57736 |
|
BLAKE2b-256 | 509521a32ffc2cab053dfbc8d4929c27785346833c73c0e8959d54a321ffea4c |