Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pysmsboxnet-2022.11.0.tar.gz (4.7 kB view hashes)

Uploaded Source

Built Distribution

pysmsboxnet-2022.11.0-py3-none-any.whl (5.0 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