Asanak SMS client for sending and reporting messages via REST API
Project description
📦 Asanak SMS Client (Python)
یک کلاینت پایتونی برای ارسال پیامک از طریق API Asanak
🚀 نصب پکیج
از PyPI:
pip install asanak-sms-client
از GitHub:
pip install git+https://github.com/Asanak-Team/python-sms-client
📚 استفاده از کلاینت
from asanak_sms_client import AsanakSMSClient
client = AsanakSMSClient("username", "password")
1- ارسال پیامک تکی یا چند مقصدی
try:
data = client.send_sms("9821X", "0912000000", "کد تست 1234")
print(data)
except Exception as e:
print(e)
2- ارسال پیامک نظیر به نظیر (P2P)
try:
data = client.send_p2p(["9821XX1", "9821XX2"], ["0912000000", "0912000001"], ["کد تست 1234", "کد تست 4567"], [True, False])
print(data)
except Exception as e:
print(e)
3- ارسال پیامک خدماتی با قالب (OTP)
try:
data = client.send_template(1234, {"code": "1234"}, "0912000000", True)
print(data)
except Exception as e:
print(e)
4- استعلام وضعیت پیامک
try:
data = client.msg_status(['12345678', '12345679'])
print(data)
except Exception as e:
print(e)
5- مشاهده موجودی اعتبار پیامکی
try:
data = client.get_credit()
print(data["credit"])
except Exception as e:
print(e)
6- مشاهده موجودی اعتبار پیامکی (ریال)
try:
data = client.get_rial_credit()
print(data["credit"])
except Exception as e:
print(e)
7- دریافت لیست قالبهای پیامک
try:
data = client.get_templates()
print(data)
except Exception as e:
print(e)
📝 پارامترهای ورودی
username: نام کاربری از API Asanakpassword: رمز عبور از API Asanakbase_url: آدرس سرور API Asanak (پیشفرض:https://sms.asanak.ir)
📝 پارامترهای خروجی
{
"meta": {
"status": int,
"message": string
},
"data": list
}
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file asanak_sms_client-0.0.0.tar.gz.
File metadata
- Download URL: asanak_sms_client-0.0.0.tar.gz
- Upload date:
- Size: 4.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
69f0216603aea153e9111e08e5e4d608d881266a7c5f1def4a35b8bbbcfb092e
|
|
| MD5 |
5d6aef06e4af4da2993c1b7a9a971106
|
|
| BLAKE2b-256 |
4d8146266fac90e91d507f9943adb9e75725ddae8cd315912e68678e622aec1d
|
File details
Details for the file asanak_sms_client-0.0.0-py3-none-any.whl.
File metadata
- Download URL: asanak_sms_client-0.0.0-py3-none-any.whl
- Upload date:
- Size: 4.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d4b6f6f02166974c469446b0abb63eac30e902b032e759b5ec080c3e9e3d24fc
|
|
| MD5 |
01f284a959e35ef57f37fadd1d5c0603
|
|
| BLAKE2b-256 |
a6f12ea8a05faa8d80d755dbe2412600b7a06b7151bc3299dd8562f19dcc3a71
|