Skip to main content

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


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)

Uploaded Source

Built Distribution

smsaero_api-2.2.0-py3-none-any.whl (3.9 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page