Python SMSPilot API
Project description
SmsPilotPy
Не официальный клиент API проекта SMSPilot
Установка
pip install sms-pilot-py
Пример использования
from sms_pilot import SmsPilot
API_KEY = 'XXXXXXXXXXXXYYYYYYYYYYYYZZZZZZZZXXXXXXXXXXXXYYYYYYYYYYYYZZZZZZZZ'
api = SmsPilot(API_KEY, default_sender='INFORM')
result = api.send_message(79201112223, 'Привет, мир!')
print(result.status, result.get_status_verbose())
print(result.cost)
# Запрос PING
ping_response = api.ping(79201112223)
# time.sleep(10)
ping_result = api.check_ping_hlr(ping_response.server_id)
if ping_result.is_ot_of_service():
print('Не обслуживается')
Отправка нескольких сообщений
from sms_pilot import SmsPilot
from sms_pilot import Callback
API_KEY = 'XXXXXXXXXXXXYYYYYYYYYYYYZZZZZZZZXXXXXXXXXXXXYYYYYYYYYYYYZZZZZZZZ'
api = SmsPilot(API_KEY, default_sender='INFORM')
api.add_message(79221112233, 'Hello')
api.add_message(79221112222, 'Привет', sender='MYSENDER')
api.add_message(79122334434, 'Привет мир', id=455, callback=Callback('https://smspilot.ru/callback', 'POST'))
result = api.send_messages()
print(result.cost)
for msg_result in result.send:
print(msg_result.status, msg_result.id)
Для использования требуется регистрация на https://smspilot.ru
Больше информации о API на http://www.smspilot.ru/apikey.php
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
sms-pilot-py-0.3.tar.gz
(7.7 kB
view hashes)
Built Distribution
Close
Hashes for sms_pilot_py-0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2423d564bd6d132904272074319d91ce3aae60566207dd38627dd6942191edaf |
|
MD5 | 4117db7f5639f0a06a162e357bc34655 |
|
BLAKE2b-256 | ec0b6dd328592a79ae6ec2dabfbdd93be00860f2ac9e2651623eaaba1ecb6ce2 |