Send SMS via smsaero.ru gate
Project description
SmsAero Python Api
Installation:
$ pip install -U smsaero_api
Usage:
Get credentials from account settings page: https://smsaero.ru/cabinet/settings/apikey/
SMSAERO_EMAIL = 'your email'
SMSAERO_API_KEY = 'your api key'
def send_sms(phone: int, message: str) -> dict:
"""
Send sms and return results.
Parameters:
phone (int): Phone number
message (str): Message to send
Returns:
data (dict): API request result
"""
api = SmsAero(SMSAERO_EMAIL, SMSAERO_API_KEY)
res = api.send(phone, message)
assert res.get('success'), res.get('message')
return res.get('data')
if __name__ == '__main__':
data = send_sms(70000000000, 'Hello, World!')
pprint(data)
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
smsaero_api-2.2.0.tar.gz
(4.0 kB
view hashes)
Built Distribution
Close
Hashes for smsaero_api-2.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cf36f5319bda3012ba38280434e3837a10e00501a51443c65f4ab0ac0e6949b6 |
|
MD5 | 7a1ee99a46a41ae93fcce9e92f8d068a |
|
BLAKE2b-256 | d1ac568647169110a6fe63b59d1f01e2b21e6beec3535032f1d3aab509a654a6 |