Client to send SMS using www.smsbox.net API
Project description
pysmsboxnet
Asynchronous Python library for smsbox.net API. Currently it allows to send a SMS, using the v1.1 API. You can also download the documentation. Future version might allow to use other account features, this doc is in French. The exception is the credits async property which allows getting remaining credits.
How to use
See example.py.
The pysmsboxnet.net.api.Client
has the following methods:
- Constructor which takes the following arguments:
- session: an instance of aiohttp.ClientSession
- host (str): the SMSBox API endpoint I.E.
api.smsbox.pro
(without http(s):// because https is forced) - cleApi (str): your smsbox.net API key, see API documentation; name is in French to reflect API documentation
- timeout (int, optional, default 30
- Send (return int: 0 or ID of sent SMS if applicable)
- dest (str): the SMS recipient, see API documentation about how to format
- msg (str): your message
- mode (str): same as mode in the API documentation
- parameters (dict): to add other API parameters, for example the minimum to add is
strategy
- credits: async property which returns remaining credits as float
Exceptions are implemented and thrown: pysmsboxnet.exceptions.ParameterErrorException
, pysmsboxnet.exceptions.AuthException
, pysmsboxnet.exceptions.BillingException
, pysmsboxnet.exceptions.WrongRecipientException
, pysmsboxnet.exceptions.InternalErrorException
, pysmsboxnet.exceptions.HTTPException
.
In case of an unknown exception, pysmsboxnet.exceptions.SMSBoxException
is thrown.
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
Hashes for pysmsboxnet-2022.11.0b1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 831351c98cc735ec126f512026ec111e0857abcc7fd749527a45ea624a26c313 |
|
MD5 | 569cb6cb36f5136abca697a175a4034b |
|
BLAKE2b-256 | 39eb7f48362eed361abbfaf947a46f796983a99a7d53aa9793c2486f43300f10 |