Skip to content

Python script for sending free SMS via Yegara Host SMS Gateway. Ideal for sending OTPs, notifications, and alerts from your websites and apps.

License

Notifications You must be signed in to change notification settings

abelzk/yegara-host-smsapi-python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 

Repository files navigation

yegara-host-smsapi-python

This repository contains a Python script that allows you to send free SMS messages using the Yegara Host SMS Gateway. You can use this script to send OTP, notifications, alerts, and other messages from your websites and apps.

Contributors Forks Stargazers Issues MIT License LinkedIn


ethiosolve 3d logo

Yegara Host SMS API Python Script

Simple python script to implement SMS API for your sites.
Visit Ethiosolve»

Yegara Documentation Plagiarism Checker · Referral Programs ·

Table of Contents
  1. About The Project
  2. Getting Started
  3. Usage
  4. Contributing
  5. License
  6. Contact

About The Project

Project Screen Shot

This repository contains a Python script that allows you to send free SMS messages using the Yegara Host SMS Gateway. You can use this script to send OTP, notifications, alerts, and other messages from your websites and apps. The script uses the Yegara Host API to communicate with the SMS Gateway and requires a valid API key and sender ID. You can also use the WordPress plugin provided by Yegara Host to integrate the SMS Gateway with your WordPress site. This script is easy to use and customize, and it supports both Unicode and non-Unicode characters.

Create app.py to get started.

(back to top)

Prerequisites

  • To use this script, you need to have Python 3 installed on your system and install the requests library using pip: pip install requests You also need to have a Yegara Host account and a domain name registered with them. You can sign up for a free account here.

(back to top)

Usage

First import these libraries

  • import random
  • import string
  • import requests

To use this script, you need to edit the following variables in the code:

  • username: Your domain name registered with Yegara Host.
  • password: Your Yegara Host account password.
  • to: The phone number of the recipient in international format (e.g. +251911234567).
  • message: The message you want to send. If you are using a template, this will be the variable part of the message (e.g. OTP code).
  • template_id: The template ID of the message you want to send. You can choose from the predefined templates or create your own custom template in your Yegara Host dashboard.

The script defines two functions: generateOTP() and sendSMS(). The first function generates a random 4-digit OTP code using the random module. The second function sends an SMS message using the requests module and prints the JSON response from the server.

You can run the script from the command line or import it as a module in your own Python program. The script will generate a random OTP code and send it to the specified phone number using the ‘otp’ template. You can change the template ID or the message as per your requirement.

Template IDs

otp
otp_1
welcome
welcome_1
reminder
reminder_1
shopping
shopping_1
confirmation
confirmation_1

For more examples, please refer to the Documentation

(back to top)

Reference

(back to top)

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

(back to top)

License

Distributed under the Apache License. See LICENSE.txt for more information.

(back to top)

Contact

Abel Zecharias - Instagram - abelzeki24@gmail.com

Project Link: https://github.com/abelzk/yegara-host-smsapi-python

(back to top)

About

Python script for sending free SMS via Yegara Host SMS Gateway. Ideal for sending OTPs, notifications, and alerts from your websites and apps.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages