Skip to main content

SmsAPI client

Project description

smsapi-python

Build Status PyPI

Client for SMSAPI.

COMPATIBILITY

Compatible with Python 2.7+, 3.+.

REQUIREMENTS

requests

INSTALLATION

If You have pip installed:

sudo pip install smsapi-client

else You can install manually:

git clone https://github.com/smsapi/smsapi-python-client.git

cd smsapi-python

python setup.py install

Client instance

If You are smsapi.pl customer You should import

from smsapi.client import SmsApiPlClient

else You need to use client for smsapi.com

from smsapi.client import SmsApiComClient

Credentials

Access Token

from smsapi.client import SmsApiPlClient

token = "XXXX"

client = SmsApiPlClient(access_token=token)

Examples

Send SMS

from smsapi.client import SmsApiPlClient

token = "XXXX"

client = SmsApiPlClient(access_token=token)

send_results = client.sms.send(to="phone number", message="text message")

for result in send_results:
    print(result.id, result.points, result.error)
  • You can find more examples in "examples" directory in project files.

Error handling

from smsapi.client import SmsApiPlClient
from smsapi.exception import SmsApiException

token = "XXXX"

client = SmsApiPlClient(access_token=token)

try:
    contact = client.sms.send(to="123123")
except SmsApiException as e:
    print(e.message, e.code)

LICENSE

Apache 2.0 License

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

smsapi_client-2.9.7.tar.gz (13.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

smsapi_client-2.9.7-py2.py3-none-any.whl (21.1 kB view details)

Uploaded Python 2Python 3

File details

Details for the file smsapi_client-2.9.7.tar.gz.

File metadata

  • Download URL: smsapi_client-2.9.7.tar.gz
  • Upload date:
  • Size: 13.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for smsapi_client-2.9.7.tar.gz
Algorithm Hash digest
SHA256 95dfe1fe1f4a5902c1529f063366df8311c21c817744b0e3bf47d703caeb3486
MD5 fec137c88e0ab073aff3fbc923451518
BLAKE2b-256 10c072bbc7bd193823453999c4da0a0e975160c424c65d1e4c93fbf96c1fe65c

See more details on using hashes here.

File details

Details for the file smsapi_client-2.9.7-py2.py3-none-any.whl.

File metadata

  • Download URL: smsapi_client-2.9.7-py2.py3-none-any.whl
  • Upload date:
  • Size: 21.1 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for smsapi_client-2.9.7-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 b347ea6e43ed6e9c26d933ddfd6a4df65afd74806aaffbf41dc5a138cd6b6972
MD5 d736c46787c5b28a71d72a66095be8c2
BLAKE2b-256 af5c94ca19c6d266c3169beb76cecd4fd24fbad8d0ccf0cafd2b8da47a1111f4

See more details on using hashes here.

Supported by

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