Python library that helps you send SMS using SMS API Guru API
Project description
SMS API Guru python client
Supported Python Versions
This library supports the following Python implementations:
- Python 3.6
- Python 3.7
- Python 3.8
- Python 3.9
- Python 3.10
- Python 3.11
Installation
pip install sms-api-guru
Sending an SMS
To send an SMS, you have to create an API key using the SMS API Guru dashboard. When you register an account, you automatically get an API key with one free SMS which you can send anywhere.
Just send a message
import sms_api_guru as api
api.set_key("YOUR_API_KEY")
api.send_sms("+381611231234", "Dummy message text...")
Handle send message request result
result = api.send_sms("+381611231234", "Dummy message text...")
if(result.ok):
print(result.price)
else:
print(result.message)
Example result object of the successfully sent message
{
"ok": true,
"message": "Message sent successfully",
"price": 0.05
}
Example result object of the unsuccessfully sent message
{
"ok": false,
"message": "API key not found"
}
Verifying a phone number
You can also use our service to easily verify a phone number, without storing data about the phones that you are about to verify, because we can do it for you.
Example usage
# User has sent his phone number for verification
result_sms = api.send_verification_code("+11234567890", service_name, seconds)
# Show him the code submission form
# We will handle the verification code ourselves
# The user has submitted the code
result_code = api.verify_code("+11234567890", user_entered_code)
# if `result_code.valid` is True, then the phone number is verified.
Verification options
service_name
is what the user will see in the verification message, e. g. "Your verification code for Guest is: CODE"
seconds
is how many seconds the code is valid. Default is 10 minutes. Maximum is one day.
Getting help
If you need help installing or using the library, please check the FAQ first, and contact us at support@smsapiguru.com if you don't find an answer to your question.
If you've found a bug in the API, package or would like new features added, you are also free to contact us!
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
Built Distribution
File details
Details for the file sms_api_guru-0.0.2.tar.gz
.
File metadata
- Download URL: sms_api_guru-0.0.2.tar.gz
- Upload date:
- Size: 4.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2967431f019de9cc97fb5f375874a8d1fe0620d4c061945f4a4109985a6b1c3b |
|
MD5 | 467f1be565cb9de5c0823f6883211af2 |
|
BLAKE2b-256 | 527ae8fce681ac8c817d5daa418d6c5a54fe9a449902a97dbe4201339c7aa278 |
File details
Details for the file sms_api_guru-0.0.2-py3-none-any.whl
.
File metadata
- Download URL: sms_api_guru-0.0.2-py3-none-any.whl
- Upload date:
- Size: 4.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d87cb6436d0db63399175d5101a14c0f95d4ac3c2c5a96434ab074a29fc7f481 |
|
MD5 | c0d27447d6e144ab7eac676de9ed94aa |
|
BLAKE2b-256 | 5dbba085f42d5e8050cd7aa16263853bb300477271cb9060991cde014998845f |